storyboard

谈谈iOS 5和Storyboard的应用本地化

泪湿孤枕 提交于 2019-12-11 10:58:10
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在使用Nib和Xib文件,也就是Interface Builder的iOS 4.x SDK中我们通过NSLocalizedString和Nib文件来本地化字符串。其中还涉及字符串文件的编写,十分麻烦。 在iOS 5和Xcode 4.2我们也可以这样做,不过这不是我想讲的重点,iOS 5的新特性Storyboard中提供了更加便捷的iOS应用本地化的方法,我们甚至不用编写一行代码就可以实现所有语言的本地化,当然前提是你会那种语言。 首先我们建立一个新项目,我这里建立了一个TabBar的实例,你可以随意。记得选中使用Storyboard,之后选中Storyboard,在第一个检查器,也就是Info Inspector中,第三项Localization中,按下加号,选择你要加入的语言,我这里加入了中文: 做完这一步你会发现,Storyboard的右边出现了一个小三角,单击这个小三角,会出现两个Storyboard,一个后缀中有(Chinese),这就是我们的本地化文件了,选中它进行翻译。 翻译完成后记得把类都设置好,我们打开模拟器,先运行一下英文的。之后再调整语言到中文。 再看看,完美运行,几乎所有的本地化操作都可以这样完成,很简单吧! 来源: oschina 链接: https://my.oschina.net/u

Removing FrameworkElements on Animation Completion

佐手、 提交于 2019-12-11 10:47:39
问题 I've been teaching myself WPF through Sells/Griffiths' "Programming WPF", and I've found it a great resource, but I'm trying to take some of the concepts they've introduced me to and go a step further, and I'm running into a conceptual snag on how to put the pieces together to accomplish what I'm trying to do. In this exercise, I'm trying to create self-terminating animations; FrameworkElement s that are created by Events, perform an animation, and then delete themselves. I'm having problems

iOS: Find all controls with the same tag

心不动则不痛 提交于 2019-12-11 10:38:58
问题 I have created a storyboard with 12 buttons, 12 smaller buttons and 12 labels. It is like that: btnBig1.tag = 1 btnSmall1.tag = 1 lbl1.tag = 1 btnBig2.tag = 2 btnSmall2.tag = 2 lbl2.tag = 2 etc... Now when a procedure is called - (IBAction)processButtonUpInside:(id)sender { UIButton *nButton = (UIButton*)sender; int nInt = nButton.tag; } ... I would like to do something with all 3 controls (big button, small button and label). It should look like this (pseudo-code): - (IBAction

sorting document outline in xcode 6

喜你入骨 提交于 2019-12-11 09:35:21
问题 in the document outline the scenes are sorted as they are added to the storyboard. Now after having added all scenes I want to sort them in a "content logic" to find them easier. Is it possible to re-arrange them manually and if so, how? 回答1: This can be done via storyboard xml. Just right click storyboard and open it as an xml. You should be able to see tag "scenes" which contains "scene" which is viewcontroller. The order presented under "scenes" tag correspond to the one you can see under

how to connect two viewcontrollers to same navigationcontroller in storyboard iphone

若如初见. 提交于 2019-12-11 09:25:06
问题 I am doing an application where i can check for a condition in Appdelegate class as follows:- if([array count] == 0) {one viewController} else{another viewController} How will i do this in storyboard like i'm asking the connection so that the corresponding viewcontrollers are displayed. I'm new to iphone development.Thanks in advance. 回答1: The way to do this is: Create a regular UIViewController: this will be your root view controller. Create the 2 other UIViewControllers. Create 2 segues

UIView at top of UITableView in UITableViewController without scroll

六眼飞鱼酱① 提交于 2019-12-11 09:14:00
问题 I added uiView above uiTableViewController, inside of my table I have some data with scroll but I don't want to have scroll for this uiview above my table does anyone knows what should I do? Thanks in advance! 回答1: Don't use a UITableViewController . Use a UIViewController with a UITableView and your additional UIView at the top. A TableView Controller expects its view to be the only one. Using a View Controller with a TableView gives you much more flexibility (A UISearchBar that is always

How to display Login and dismiss Settings - Storyboard

ぐ巨炮叔叔 提交于 2019-12-11 09:04:39
问题 I am trying to figure out how to display Login (modal viewcontroller) from logout button and automate dismiss Settings (modal viewcontroller) from underneath of Login. You may see the storyboard layout: http://cl.ly/2B3h0T130S1K1026201N I tried to add this code into logout method in SettingsViewController.m - (IBAction)logoutAccount { [self dismissModalViewControllerAnimated:YES]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *vc =

Stop StoryBoard after currently running animation is completed

霸气de小男生 提交于 2019-12-11 08:59:30
问题 I want to stop WPF StoryBoard after property of control IsAnimating is changed to false, but I need to stop animation not instantly, but first complete currently running animation cycle and then stop it (I'm using this XAML now, but it stops my animation instantly): <UserControl x:Class="App.Controls.ProgressCircle" x:Name="me" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org

How can I push a new View Controller from a button within a subView (another View Controller) in Storyboard

不打扰是莪最后的温柔 提交于 2019-12-11 08:24:17
问题 Wow, I gave a big thought on the question! So I have a view Controller called "ContentView" within another view Controller (Main VC). The Main VC has a Navigation Controller which was created using Storyboards. And the contentView loads 3 different view controllers (vc1, vc2 and vc3) depending on the options that a Segmented Control has. So the question now is: How can I load a new View Controller from the button within one of the subviews (vc2) that will appear once the user selects the

Empty custom prototype cell

百般思念 提交于 2019-12-11 08:23:26
问题 I'm new in iPhone development and have problem with prototype cell. In my storyboard, I have navigation controller. I pushed it with view controller (as main window), it has a button, when I click it I open tableView controller with custom prototype cell - (IBAction)searchClick:(id)sender { CNCarTableController *car = [[CNCarTableController alloc]init]; [self.navigationController pushViewController:car animated:TRUE]; } But when it opens it has empty rows - (UITableViewCell *)tableView: