Button and label not showing in Interface Builder and the simulator even if they are not marked as "hidden" - ios

I have just started learning ios and I was making a button tap counter app, where an user can tap the button for a entered number of times. The problem that I came across is mentioned in the title. Please see attached screenshot image for clarification. Notice in the screenshot that the app logo isn't shown when "Hidden" is unchecked. When "Hidden" is checked, the logo isn't shown, but its fine because that is just how it is (just mentioning). This is the case for all other buttons, images, labels and text fields.

You have a Z axis issue.
Meaning, a UIView is on top of your UIButton.
You will need to drag the UI elements downwards in order to change the Z axis hierarchy:
Also, you could figure this issue by yourself if you would use the Debug View Hierarchy:

Related

I want to remove corner radiuses

I'm developing iOS app with XCode.
My problem is a corner radius of UIViewController as below.
I want to remove it. It's shown on only iPhone7 simulator.
Please help me.
Get a reference to your UIView's layer and then call this function:
view.layer.cornerRadius = 0
It could be a couple of things:
Corner radius;
Background image that incorrectly had its corners rounded; or
Mask applied to the layer.
If you’re having trouble identifying the specific view that this has this applied, use the view debugger. So, run the app via Xcode and then tap on the view debugger button .
When your views appear in Xcode’s view debugger, rotate the view and select the culprit.
Once you’ve highlighted the view of interest, you can press shift+command+D, or choose “Navigate” » “Reveal in Debug Navigator” from the Xcode menu , and it will highlight the view in the view hierarchy shown on the left. Or if you choose the object inspector in the right panel, you can see the class name, and if it’s one of your classes, you can click on the little arrow to the right and you will be taken directly to your code.

XCode UI Builder not showing blue lines

I am very new to IOS development and starts working on xcode. In its UI Builder I am not able to see any blue lines when I am dragging it to place in any portion of the screen. I have already selected Editor>Canvas and selected Show constraints, Show Bound Rectangles, Show Device Bezels. I have selected Use Auto Layout & Use Trait Variations as well.
These kind of blue lines I want when I am dragging button:
Those are Guides and you want to enable Snap to Guides like here.

Issue with displaying an alert like view

In Android, on the click of a button I get a screen coming up (the one on the left with just the First Name and Last Name) and on click of the more button the other fields are also displayed (the image on the right).
I tried to achieve this by loading another view on the click of the button, but this shows a view completely filling the screen and not like the one in the image with limited height and the background view being greyed out.
Also to get a screen like the one on the left I made their height constraints equal to 0, but though it showed just 2 textfields, the screen filled the whole screen and not like the one on the left.
Any idea as to how this can be achieved?
To show custom transition while presenting a controller i.e.
your first requirement - a view completely filling the screen & not like the one in the image with limited height and the background view being greyed out.
you can use UIViewControllerAnimatedTransitioning.
I have created a sample here:
https://github.com/pgpt10/Custom-Animator

Swift: Setting View on top of SceneView not working

I'm trying to set up a layout where a Map is placed on top of the SceneView. When the app builds, the set up flashes for a second, and then the SceneView takes up the whole screen, completely hiding the other two views.
After moving the SceneView on the left hand menu and moving it back, the text started appearing but not the black background.
(I've got constraints set for the Scene View to take up the whole screen, and some constraints (right and bottom) on the Map too.
Why is it not working?
EDIT: It started working after I deleted the view and added it back in, but not sure why. #El Tomato says SceneViews always overlaps other views. Is this true (i.e. by accidentally getting it to work, am I utilizing a bug)?
It is doable. I'm doing it currently with an app I am using, but the difference is that I didn't set up the ARSceneView in the Interface builder, but I added it to fit the whole screen programmatically. I have some buttons that were added through the interface builder, and I added a label with a background now just to make sure it works similarly to how you want it.
I will post some images:
Here i simply have the view controller with some (bad looking buttons) in the stack View as well as the label with a red background. The ARSceneView is added in the my ViewDidAppear function and takes up the whole frame.
This picture is from the screen while the app is executing (Debugging the UI). As you can see, the Label with the background as well as the buttons I've added all show.
I also have 2 buttons that are showing as well (the white and red circle) and these were added programmatically and were brought to the front.
My suggestion is to try and add the ARSceneView programmatically, maybe it doesn't work otherwise. Or you can try to outlet all your views and bring the Map View and the Label to the front using bringSubviewToFront.

ios any UIView property allows me to set buttons underneath the view in-active?

For ratation and iAd and design reason, I don't want to use modal view to present a message (not via alert view either). I plan to bring up a screen-sized label up and show the message there. That can be done. However, there are a bunch of buttons (ABCD etc) underneath the big label and those buttons are logged in different status and they are clickable. Ideally a user would read the label and disable it via a specified button (X). However, users could click anywhere they want and more than often they will hit those buttons underneath the big label and screw up things. When the big label shows up, only X is visible, and ABCD etc are invisible. Now my question is there any UIView property or whatever property that I can set so that buttons that are invisible are not functioning, although they might be enabled.
You can set the alpha property on your buttons to 0. This will have 2 effects:
1) make the buttons invisible
2) make them ignore the user input
When you need to re-enable the buttons, just set their alpha to 1 again.

Resources