interface-builder

How “Unknown class <MyClass> in Interface Builder file” error can be fixed with a line reads “[MyClass class]”?

房东的猫 提交于 2019-12-25 01:46:35
问题 I read the following answer, so I know that "Unknown class in Interface Builder file" error can be solved using the -ObjC linker option. (FYI, MyClass is in static library.) https://stackoverflow.com/a/6092090/534701 I've also found that single line of [MyClass class] code in the App Delegate can handle the same problem without using -ObjC option. My Question is how come the code can work. According to the answer that I've attached above, the error occurs because symbols in my static

How to remedy a UINavigationBar overlapping the top of my UIScrollView?

こ雲淡風輕ζ 提交于 2019-12-24 23:26:59
问题 I am working with a TabBarController >> NavBarController UI. One of my UIViewControllers has a UIScrollView in it with some text (UITextField) in it. Problem is, the uppermost text in the UIScrollView is covered by the NavBar. How do I fix this? I am trying to manually adjust stuff in IB with mixed results but I want a more CERTAIN solution. 回答1: The problem is that your view is too big, and it's being positioned under the nav bar. To fix, open up the .xib with your container view and/or your

Fluid UI layout on iPhone

耗尽温柔 提交于 2019-12-24 22:46:42
问题 I have an Android app with a UI like this for viewing emails: I'm trying to port this to iOS and need it to work with iOS 5.0 and above (so can't use auto-layout in iOS 6.0). Hopefully you can tell how the layout should adjust/flow based on the example. What would be the best way to handle this type of layout? The From and Re lines need to be variable height as shown (actually the To: line as well). The message body needs to be variable height of course. My only attempt so far has been trying

Aspect ratio NSLayoutConstraint in UITableViewCell is breaks

梦想的初衷 提交于 2019-12-24 20:42:32
问题 I'm trying to set appropriate NSLayoutConstraint s for a UIImageView in a UITableViewCell . The desired constraints are as follows: 16:9 aspect ratio 0 leading 0 trailing 11 top 11 bottom The UIImageView is the sole subview of the cell's contentView. I have set tableView.rowHeight = UITableViewAutomaticDimension and tableView.estimatedRowHeight = 80 2018-03-28 15:52:30.454688-0400 TestApp[28844:694668] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of

Chromium Tabs in Cocoa (Outlets turning up NULL from 'TabContents.xib')

别说谁变了你拦得住时间么 提交于 2019-12-24 19:20:07
问题 I'm struggling to use Chromium Tabs in Cocoa and I really seem to be missing something. I've subclassed CTBrowserWindowController ( ppEditor ), CTBrowser ( ppDocumentBrowser ), CTTabContents ( ppDocument ) and CTTabContentsController ( ppDocumentController ) Editor creates new Documents by : [self addTabContents:(ppDocument*)doc]; (and I've also tried first adding a Document Controller for the specific document first, but this doesn't work either) I'm connecting my outlets from TabContents

App crash with 'Could not instantiate class named NSLayoutConstraint'

落爺英雄遲暮 提交于 2019-12-24 18:33:41
问题 In a .xib file how do I keep the Autolayout on for iOS 6 but off for iOS below 6. If I turn it off my .xib doesn't get the proper layout . If I turn it on my Iphone with 4.3 crashes. Any help would be appreciat it Thank you 回答1: I don't believe this is possible as autolayout changes how your application is compiled. The options I've considered for a workaround to this are: Detect the height of the display and programmatically change some of the elements (ick, but I've done this when it was

How to use a image instead of activity indicator?

本小妞迷上赌 提交于 2019-12-24 17:19:15
问题 in my app when i click on refresh button, an activity indicator appears. and when tableView is refreshed then it disappears. i want to use a image instead of that activity indicator in such a way that when i click on refresh that image ll come on the whole screen and when view ll b refreshed it ll disappear. how can i do that? thanx in advance 回答1: Basically what you need to do is add a "cover page" view over your current view. These usually work best if you set the alpha to about 50%.

iOS Autolayout keep distance from 2 views

前提是你 提交于 2019-12-24 15:47:02
问题 I'd like to have some views fixed on the top of the screen, some other on the bottom and a single fixed size view in the equal distance between the top and bottom views. I cannot figure out how to do this with Autolayout constraints. Do I need to add some spacer views to the UI, or calculate the desired position programatically? 回答1: You can do this with only one additional view. It'd look like this: stuff_on_top middle_view (with fixed size view inside) stuff_on_bottom There'd be vertical

Why do I have to set trailing space to -16 in Interface Builder to get full screen width?

寵の児 提交于 2019-12-24 15:34:50
问题 I'm building an iOS application and would like to have a menu that appears from the bottom and can be opened with an upwards swipe. Doing this programmatically works easily. Since I would also like to learn how to do this in Interface Builder I gave it a try and now Interface Builder is driving me crazy. What I did: Create a new View Controller in story boards. Add the arrow so that this controller is shown first. Add a view to the bottom of the View Controller's view. Let's call this view

Constraints and margins in xcode 6, margins revealing whitespace after snap

允我心安 提交于 2019-12-24 11:24:30
问题 I'm trying to constrain a couple of views within a controller. I understand how to set spacing between views, and width/height for each view. I'm a little unsure about dynamic height and width, I'm assuming that it's the margin-locks duty to adjust the weight appropriately. Advice on this would be much appreciated. Anyways, I'm trying to set a "Trailing Space to: Superview" constraint, which automatically sets to -16. See photo: As you can see, I've selected margins for left right and top of