Xamarin.iOS UISwitch tap issue - ios

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.

Related

xCode7 StackViews inside ScrollView overlapping views

this is my first job with xCode and I'm migrating an Android App to IOs. I'm attempting to create a ScrollView with some items inside of its content view. Below is a print of the Storyboard tree:
When I run the app, the items below the selected StackView, including it, do not appear correcly on the simulator. They are all overlapped at the top of the screen:
I have already double checked all the constraints, along with other properties on the views but could not find the issue. Any help will be very appreciated.
Thanks!
=========================================
Thanks, Imran. This helped me find the issue. But I still would like to understand it. As you can see from the picture below, some of the views in my storyboard have this "wAny hR" property set. Literally all the stackviews and, the Labels and Buttons which were messy. Once I remove this property and set the "Installed" one, they showed up ok. Any thoughts on that?

Constraints Problems with table view cell

I have problems with constraints in table view cell. As you can see in the image above , I tried to constrain the label on the far right so that label will be closer to the right right edge. But that isn't reflecting on the ipad in preview. Whats wrong? and How do solve this problem ? Thanks for any help !
The prototype cell in the storyboard is just that: a prototype. It isn't "real". It will be used as a cell when the app runs, and layout will occur. But the Preview in the storyboard in Xcode (in your version of Xcode) doesn't reflect any of that.
So the only way to see the effect of your constraints is to build and run the app in an appropriate Simulator.

UILabel in UIScrollview strange behaviour

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.

iOS 7: Misplaced View Frame for "Label - Label" will be different at run time

I just finished an app on iOS 6 and bought a developer account a week ago so haven't had much time playing with the iOS 7 SDK. Just downloaded the Golden Master version and trying to upgrade my app to be compatible with iOS 7.
I received a lot of warnings saying
Misplaced View Frame for "Label - Label" will be different at run time.
and I am unable to run the program. The project contains tableview and its is parsing and displaying XML feed from an RSS.
How to fix this issue?
The accepted answer will fix the problem, but that's not a good solution because it'll remove all your constraints. If you have spent hours on the constraints then don't do that.
If you click the triangle next to the warning you can get the explanation of what is misplaced. Then you can just move the frame to where it's supposed to be. For example:
In this case I just moved my Text View's y position to 94 and the warning will go away. This is because one of my constraints will force the view to be somewhere else when the app is running, but the position is different than where it currently is in the storyboard.
Another way to move the frame to the right position is to click on the warning next to the View Controller name in your storyboard, and then click on the yellow warning sign, and click update frame.
These two methods are not destructive and will not remove your constraints. If anything it'll show that you may need to do minor readjustments in your constraints.
I had the same issue and I get below response form Apple:
You need to update the constraints to match the frames of these views.
I did the following:
Editor -> Resolve Auto-Layout Issues -> Clear all constraints in ** view controller
then I reordered my objects again in the view.
PS: Try Enrico's solution first.
I had the same issue what you need to is , update the constraints or update the frame.
On storyboard you have a small tool bar as shown in below image.
Please see the meaning:-
You can either choose "Update Frames" or "Update Constraints" and Use "Reset to Suggested Constraints".
This will resolve the issue regarding misplaced View.
Don’t drag and drop views to make adjustments to layout. Edit the applicable constraints instead.
Please , let me know if you not clear.
If you are having troubles finding the Update Frames in xCode it can be done like so:
None of the answers work in all cases. As of recent version of Xcode, using a UISearchBar, enabling scoping field enabled in IB makes the search field appear double height (but doesn't show a the scoping bar beneath it). Whether or not you add a height constraint (of any height) to the search field, you'll get the warning that it is a misplaced view that will be 88 H at runtime but is 44 H in IB. Updating the frames (any or all frames) doesn't resolve it. Seems like a bug in IB.

UIButton not in the same place on storyboard

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.

Resources