I have UIView (popupView) which I'm adding it to another UIView (superView). This superView contains an UILabel with some text in it. Now this UILabel's text is disturbing the popupView content. For better understanding, you can check the attached screenshot (If you check screenshot, you can observe the line in the popup view was breaking with backside UILabels content). Please help me what went wrong in this or do I need to enable any property for UIView or UILabel.
Related
I have a really strange problem on my App.
The issue is that:
The UIButton inside an UIView used as Footer in a UITableView respond correctly to touch only for the half of the height.
No views are over the UIButton.
I drawn a red line on the touchable part:
And this is the Debug View Hierarchy
Is this a UITableViewCell? It looks like the content view's frame isn't as big as the cell's frame. Maybe the bottom constraint of the button is set to the cell's bottom rather than the cell's content view's bottom.
I am creating a vertical UIStackView inside a UIView and placing UILabel elements inside it.
Now, I want to change the height of Label inside the UIStackView. But the height property seems to be disabled.
Alternatively, I am able to set height constraint for the label and change it's value programatically. I want to know if there is a way to change the value in the XIB itself as my purpose is to set a static value and cut down on adding code for it.
First add UIView in UIStackView and Then Add UILabel under view. Set label's constraint. Now you can just change the UIView Frame from Size inspector, it will automatically change the label frame.
I'm Learning Swift, and I want to figure out how I can scroll the UILabel
I have a Label that is populated dynamically , But the text goes under the bottom bar.
I tried with 0 Lines, Constraints.. I'd like to scroll the view for read whole text
UPDATE
After the answers I have this situation
With Textview I Can read all my text, using the scroll
With UIScrollbar and UILabel, I can't read all my Text.
When I have to use TextView instead of UIScrollBar+UiLabel?
Alternatively, you can replace UILabel with UITextView.
Then set textView.editable = false.
Add the UILabel into a UIScrollView. Set the content size according to the size of the UILabel.
You can also use a scrollview, if you have more than one control to scroll together. For example you have an image on top and a description below and you want to scroll them together, you can use a UIScrollView. Just put the image view and UILabel inside the scrollview.
If its just text you want to scroll, you can use a UITextView.
I'm getting stuck how to put UIButton inside UITextView on bototm right side, there is one more requirement when user type in textview the text doesn't overlap on button. Below images is my requirement. How can I achieve this?Thanks
You can add UIButton inside UITextview programmatically.
textview.addsubview(button)
What you can do is put the UIButton/UIView below the UITextView in the storyboard. Since elements placed in storyboard are w.r.t Z axis. Something like this
Then give bottom and trailing constraint only so that the position of the UIView remains the same even if the UITextView is growing in height dynamically
I think you need to put the textView then place a View on top of the textView and then add the button inside the View.
I have following design.
Am using AutoLayout to make every thing flexible. In this design i have a UIView which is Gray in Color as showing in image and a UITableView below UIView. Some times i have to show this UIView and some times i have to hide this Gray UIView.
My problem is when ever i hide UIView, UITableView is not fixing its height. I don't want to hard code in .m file. Is it possible AutoLayout take care of this issue. I have these constraints as below image. Am i missing any constrain.
When i try to change UIView height, UITableView is not moving up and showing some orange constraints as show in image.
The contraints looks good. All you have to do to show/hide the gray UIView is change the height constraint constant.
To do this, create an IBOutlet in your controller for the constraint (you do this the same way you would for a UIView IBOutlet), and when you want to hide the gray view, set the constant property of the constraint to 0.
eg.
#interface MyViewController
#property (weak, nonatomic) IBOutlet NSLayoutConstraint *greyViewHeightConstraint;
#end
and when you want to hide the view:
self.greyViewHeightConstraint.constant = 0;
To show the view again, you would have to save the "default" constant value after the storyboard is loaded (like in viewDidLoad for example), and set self.greyViewHeightConstraint.constant to this saved value.
Note also that these constraint changes can be animated.
The "orange constraint" you are seeing in Interface Builder is normal: it indicates that the view frame is not matching the constraints you set. You can then update the frame to respect the constraints, or update the constraints to match the frame.