Strange issue faced today. Xcode 8.3.2 while using UIScrollView, UILabel shows outline and actual label on different place. Which also display weird in the simulator.
Anyone faced the same issue. Any solution ? I have searched google so much but found nothing.
Help me if anyone has solution.
When there is a red arrow in your view hierarchy:
It means something is wrong with your autolayout. Click on it and Xcode will provide you with the information what's wrong. In this case your scroll view needs to know size and position of your content (In your case size of the UIlabel), so it is able to stretch its content and determine if it should scroll.
Related
Is there anyone encounter this problem on Xcode 9.2?
I setup the UITableView as shown in the image above. And added a UILabel below the UITableView for demonstration. The image above is in "portrait" and the constraints work fine and ok.
When I change the orientation to "landscape" the constraints seems didn't work on the UITableViewCell although no errors is shown. While the UILabel below the table readjusted as expected it should be.
Anyone can explain this? and how could I possible fix this? It's kind of annoying...
Xcode version: 9.2
After the update to Xamarin.iOS 10.2 and iOS SDK 10.2, the UISwitch in my app seems to be hardly tappable (works only if I tap inside the red circle, in the image below).
Moreover the label (to the right of it) appears ON it despite it has a constraint which should place it at 10 from UISwitch.
The entire layout is made with storyboard.
Anyone could help me? I've tried everything.
Thanks in advance
EDIT
I was able to resolve this by removing these two components and adding them again. The update seems to has messed up the layout.
I was able to resolve this by removing these two components and adding them again. The update seems to has messed up the layout.
It looks like the UILabel is in front of the UISwitch.
Either set the UILabel to not take user input by using this:
myLabel.UserInteractionEnabled = false;
or fix the constraint by posting more information on the constraint or uploading the xib/storyboard file.
This must be just another autolayout question. I did do all I can think of to find out what is wrong but nothing seems to right. Maybe I'm missing something or doing something really stupid.
I added an UIImageView to a ViewController, set the autolayout constraints of the ImageView in Xcode. To see the borders, i added an IBOutlet to viewcontroller and set border width of Image to 2.0 and border color to red. It works well in iOS 6, in both landscape and portrait mode. When i run the same in iOS 7, the bottom part of the view goes under tab bar.. heavy sigh. Im hoping this is something configurable in the UI, rather than making code change. I unchecked "Unchecked" Adjust scroll view insets for ViewController , also made sure that the bottom Space ( Vertical Space) of the ImageView is set to the top of Botton Layout Guide, as mentioned in apple ios migration guide. Im not sure what else to do and im not feeling lucky. Can someone please take a look ? I already spent few days on this and im not reaching anywhere. Here are few screen shots if it helps.
Thank you for your time.
Unfortunately stackoverflow wont let me add images unless i have brownie points :(
hopefully these links would work
iOS 7 screenshot
iOS 6 Screenshot
There is an option I believe called 'under bottom bars' uncheck this and it should work.
I found this code in another post and it resolved my issue.
- (UIRectEdge)edgesForExtendedLayout {
return [super edgesForExtendedLayout] ^ UIRectEdgeBottom;
}
I have a UILabel that i placed in the top left corner of the screen in the Storyboards. I disabled "Autolayout" and it works perfectly fine on the iPhone 5 screen. The problem comes when i try them on any of the smaller screens like the iPhone 4. The label is then placed on the bottom right corner. After this issue, i tried to programmatically 'fix' the position in the "viewDidLoad" method of the view controller, but it stills moves position and the problem continues.
Ive been scratching my head about this for a while!
Any help would be appreciated.
I would suggest that you turn autolayout back on. If you get the constraints right, this situation (two different screen sizes) is exactly the sort of thing autolayout is really good for. There's a very good reason why Apple migrated autolayout from OS X to iOS at exactly the moment the iPhone 5 screen appeared on the scene!
try to fix it at viewWillAppear
Go to the utilities panel, click the tab "Show size inspector", and change the autosizing. Then drag your component in your storyboard's view so that it stays in one of the "borders". If you do not need to support older iOS versions, I'd recommend you to figure the proper way with auto-layout though.
I moved all my UIButtons to fit on a particular UIImageView and for some reason they're not matching up the to correct location as the storyboard when run on the simulator nor the iPad itself. It's weird and I'm confused.
This is a screenshot of it in the storyboard.
This is a screenshot of it on the simulator.
Notice how some of circles(buttons) the titles are shown. Why is this happening and how can I get them into the position they are in the storyboard? Thanks for the help :)
Okay, for some reason i disabled the auto layout thing on the storyboard. But, when i reenabled it it seemed to work. Strange bug, but the problem is fixed now. Thanks larme, for making me aware of the auto layout thing.