uistoryboard

Using Constraints To Keep Two TableViews The Same Height & The Same Distance Apart

让人想犯罪 __ 提交于 2020-01-02 19:12:11
问题 Context / What I'd Like to Do I'm building this for iOS 7 I'm using a StoryBoard I have two UITableViews , that I'd like to keep the same height and distance apart, to retain visual consistency between 3.5 & 4 inch devices So on the shift from a 4 inch screen to 3.5 inch screen I'd like for: The table views to get shorter but remain equal in height For the top table view to keep the same y pos For the bottom table view to shift its y pos up to maintain the same distance between the bottom of

What is the quickest way to clean up all warnings in all XIB / Storyboard files In Xcode 7

孤者浪人 提交于 2020-01-02 10:32:19
问题 In Xcode, whenever I see warnings (usually about misplaced elements) appear in the XIB / Storyboard, I have to: Select the container (Usually the containing view controller or the top most view) From the Xcode menu select Editor -> Resolve Auto Layout Issues -> All views in <container name> -> Appropriate action ( For instance: Update frames ) to resolve the issues. The above method takes requires steps and a bit time consuming to me. It would be great if I could: - Resolve all warnings for

UINavigationBar frame height returns 44.0 but is actually 64.0

回眸只為那壹抹淺笑 提交于 2020-01-02 10:20:00
问题 I have a UINavigationController in a storyboard which is not using AutoLayout. With the status bar visible the actual height of the UINavigationBar is 64.0 and yet when I log self.navigationBar.frame.size.height I get 44.0. How do I get the actual height of the UINavigationBar? I'm using Xcode 7.3 and the storyboard builds for iOS 6. 回答1: The height of the UINavigationBar is 44 . The reason you´re getting 64 is because of your status bar is visible and it has a height of 20 . Update: To

Custom UITableViewCell does not show the labels in storyboard

纵然是瞬间 提交于 2020-01-02 07:18:46
问题 In this screen shot you can see that I have added UITableView in UIViewController then customized the UITableViewCell by adding some labels in it. But the issue is when I run the application. All of the cells are empty. There are no labels at all. I am not getting what can be the issue. I have searched the web and read tutorials but couldn't resolve it. 回答1: I resolved this issue by myself, just after little effort. Actually when you create a custom cell you have to do these things: Setup the

Push View Controllers from Modal View in Storyboard

无人久伴 提交于 2020-01-02 07:00:33
问题 I am using storyboard and have a screen which is presented modally, which I then need to push other view controllers from so that I can select items for the modal view (similar to adding an entry on the iPhone Calendar app). So I am going from: Navigation Controller > VC > Modal View Controller > ??? Here I want to push a VC so that I can select an item to return to the modal view. How can I make this possible as I'm currently getting an error "Push segues can only be used when the source

Dynamic TableView Cell Heights Incorrect Until After Scrolling (iOS 8) - full screenshots attached

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 05:36:09
问题 EDIT Built a new sample project from scratch and the dynamic tableview cell height is working flawlessly. I then tried to replicate by trimming down my project to it's bare minimum and it's STILL broken (first few cells buggy). Attaching full project for both working and not working examples. Project/code literally looks 99% identical and for the love of me can't figure out where the 1% difference is. The only thing that is popping out at me is that I used different size classes (wAny hAny vs

How to set View height as percentage of the screen height in Storyboards with XCode 7

怎甘沉沦 提交于 2020-01-02 02:31:08
问题 I need to design the view like below image and I have tried with fixed heights and also tried compact width and regular height and regular width and compact height but those scenarios did not worked for me. How can i set View height as percentage of the screen height in Storyboards? I'm using Xcode 7 回答1: Basically you need to act on the multiplier property of an height equal constraint. To do that while pressing CTRL, drag from the view to its superview and select equal heights constraint ,

Xcode change storyboard's frame value automatically cause git merge conflict all the time. How to solve it?

笑着哭i 提交于 2020-01-01 09:39:11
问题 Every time when I merge other team member's iOS objc project, I got some strange conflict like this: <<<<<<< HEAD <rect key="frame" x="254.00000003476939" y="0.0" width="63" height="21"/> ======= <rect key="frame" x="254.00000010362709" y="0.0" width="63" height="21"/> >>>>>>> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX We never change the value of x, and we always give integer like value. Obviously, Xcode changed the value automatically. How to prevent this kind things happen? 回答1: You could

“Installed” option in Attributes Inspector

拈花ヽ惹草 提交于 2020-01-01 09:23:16
问题 In Attributes inspector there is an option Installed . I am unsure of it's meaning. Does it mean that the element will be present in any size class? 回答1: It is for adding that specific view to the corresponding size class. If the installed is checked it will be added to the view hierarchy of that size class, else it won't be added. You can check more about this option in Enable And Disable Views. 来源: https://stackoverflow.com/questions/33975427/installed-option-in-attributes-inspector

UITableView cells not nil at initialization

 ̄綄美尐妖づ 提交于 2020-01-01 05:53:50
问题 I am setting up my UITableView using storyboard editor. For creating my cells I am using the standard delegate method: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SearchResultCell"]; if (cell == nil) { // Do cell setup } // etc return cell; } Except when the cell is dequeued the very first time it's not nil, as it should be. So the code inside the if statement is