storyboard

Embedding an existing UINavigationController to new view controllers

橙三吉。 提交于 2019-12-11 02:27:27
问题 Suppose I have a storyboard with a navigation controller and several view controllers. All is well until I try to add a new view controller and would like to associate it with the existing UINavigationController . When I go to Editor>Embed>Navigation Controller, Xcode helpfully creates a new controller, which is precisely what I don't want. When I attempt to drag to create a wireframe, I create a segue relationship, which again is what I don't want. Is there a way to make new view controllers

UILabel updates resets view positions

旧巷老猫 提交于 2019-12-11 02:22:57
问题 I have a small problem with updating an UILabel. I tried a "Pong" Game tutorial which uses UIViews for the ball and the players. So I positioned them with the help of the storyboard on their start positions. The game works well, but if I implement a UILabel for displaying the players scores the trouble starts. With every update of the UILabel the UIViews get repositioned to their starting points. Was there something changed in iOS 6? 回答1: I ran into a similar issue. The solution was to turn

Popover segue not working

那年仲夏 提交于 2019-12-11 01:54:53
问题 I am developing one iPad application using storyboard. In my application i have 2 view controllers(First view controller and Modal view controller). In my first view controller I have one table view with cell containing one button. If I click the button in each cell I need to go to modal view controller. I connected the modal view controller and button by using a segue. Segue is working perfectly when style is modal but I need style Popover. When I am trying to change the segue style popover

IOS Custom UIBarbuttonItem change position in detail view

偶尔善良 提交于 2019-12-11 01:24:49
问题 I'm trying to customize my navigationbar's UIBarbuttonItem so that I'm using this im my Appdelegate.m // didFinishLaunchingWithOptions: { UIImage *navBarImage = [UIImage imageNamed:@"nav-bar.png"]; [[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setTitleVerticalPositionAdjustment:5 forBarMetrics:UIBarMetricsDefault]; UIImage *barButtonSave = [[UIImage imageNamed:@"nav-bar-button.png"] resizableImageWithCapInsets

UITableView only sending data to Detail View Controller on Second Try

天大地大妈咪最大 提交于 2019-12-11 01:17:24
问题 Hey there I have been working on a transit app for some time and have been stuck with this issue for a while now. I am using iOS 5 and a storyboard. Basically I have a UITableView that displays favorite bus stop locations, when a user selects a row I use: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { Favorite *favorite = [self.favoriteItems objectAtIndex:indexPath.row]; stopString = favorite.title; routeString = favorite.subtitle; } With the

WP7 - blinking background in custom button

允我心安 提交于 2019-12-11 01:06:48
问题 This is my custom button: <Style TargetType="local:AnswerButton"> <Setter Property="Background" Value="{StaticResource BlueGradient}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:AnswerButton"> <Grid> <Border BorderBrush="Blue" BorderThickness="2" CornerRadius="10"> <Border Name="myBorder" Background="{TemplateBinding Background}" CornerRadius="9"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="100"/> <ColumnDefinition Width="*" /> </Grid

Show view from storyboard chain

£可爱£侵袭症+ 提交于 2019-12-10 23:58:03
问题 I have a chain in storyboard and I want to start (for example) second view when I have first launching app. I have some code, which only work in - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation method, if I put it in - (void)viewDidLoad method it's not work, the code which show my other view is: UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *vc = [mainStoryboard

Storyboard doesn't display assets after migrating to Asset Catalog

本秂侑毒 提交于 2019-12-10 22:22:42
问题 After migrating image resources to an Asset Catalog the app builds and runs correctly but the assets don't show up in Xcode's storyboard. 回答1: In my case this occurred because I used the full asset name including file extension (i.e. '.png') in Storyboard. However, the name for the asset needs to match the name of the Image Set in the Asset Catalog: So by removing '.png' from the image name in Storyboard it solved the problem. 回答2: I've encountered a similar problem that storyboard just not

How to programmatically disable/enable a UIBarButtonItem

南楼画角 提交于 2019-12-10 21:29:34
问题 I currently have a button called continueButton that has been assigned to a UIBarButtonItem button in a Storyboard file. I've declared the button as such: - (IBAction)continueButton; When the view loads, I want the button to disable itself, so that there can be no user input unless a command is called that re-enables user input for the button. How would I go about doing this? I'm trying to use the function [continueButton setEnabled:YES]; to disable/enable the button programmatically, but it

Change constraints based on device during run time

試著忘記壹切 提交于 2019-12-10 21:14:45
问题 I'm using Storyboard to set my constraints. While everything is perfect, I have a some views where I wish to change the constraints on only 3.5" devices. Is this possible? How can I do it? 回答1: You can define a macro to determine the screen size, like the following: #define isiPhone4 ([[UIScreen mainScreen] bounds].size.height == 480)?TRUE:FALSE Later in the code you can do something like this: if (isiPhone4) { self.constraint.constant = NEW_VALUE; } To access storyboard constraints from code