Problem regarding draw image [duplicate] - iphone

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
How to set this Layout in iPhone need Some help
I draw image in imageview.
I have one image view and Button is there.
When i draw something it show like this,
I dont wan't to show drawing on that button.
How can i do that?

There are 2 approaches:
1) You can do this IB:
Drag your UIImageView in IB to bottom of your stack subviews of view where your UIView (where you are drawing) is placed.
2) You can do this in code:
Push your view on the top of views using following method
- (void)bringSubviewToFront:(UIView *)view
For example:
UILabel * labelgreen;
[labelgreen.superview bringSubviewToFront:labelgreen];

Related

UILabel Circle Background [duplicate]

This question already has answers here:
Attempting to mask a circle around an image not working
(2 answers)
Closed 2 years ago.
I want to make the label's backround full circle.
i searched and find out
numLabel.layer.masksToBounds = true
numLabel.layer.cornerRadius = numLabel.bounds.width / 2
on iphone it is fine
on ipad, firsttime it is just a corner radius rectangle, when i move tableview up and down, in anotherwords, cell view gets out of the main view and gets back in, it becomes a fine circle.
i wonder, what is the mistake i am doing ?
edit : numLabel is inside TableViewCell / TableViewController / NavigationController / splitViewController
and it has its own tableViewCell class. and that code is run From layoutsubviews()
numlabel width and height is equal by contraints
you should never call layoutSubViews directly
override layoutSubViews, don't forget to call super and then put your code there.

Gradient on a UILabel? [duplicate]

This question already has answers here:
How to Apply Gradient to background view of iOS Swift App
(30 answers)
Closed 4 years ago.
I am trying to create a UILabel that will have a gradient background color. I am wondering if there is a way to do this through the interface builder. If not, is there a way to accomplish this programmatically using the Swift programming language?
Any input or suggestions are greatly appreciated.
Thanks in advance.
You actually can't put directly a gradient layer in a UILabel, since the text will dissapear. See Adding a CGGradient as sublayer to UILabel hides the text of label
You can use an UIView, put your UILabel inside it, and then add the gradient layer to the UIView like this.
How to Apply Gradient to background view of iOS Swift App
While not the same question, it seems the answer to this may help:
How to Apply Gradient to background view of iOS Swift App
You have to create a gradient layer and insert it as a sublayer programmatically.

How to position UIButton to extreme right of UIToolbar? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to adjust UIToolBar left and right padding
As you see in the attached picture1, there is a bit of padding of some kind preventing the UIButton from going all the way to the right.
How do I position the button all the way to the right so it's touching the right of the screen?
Use flexible Space Bar Button before the button in xib or Storyboard.

How to create resizable view with handlers on sides to stretch or resize in ios? [duplicate]

This question already has an answer here:
Changing View size using user touch input
(1 answer)
Closed 7 years ago.
I am creating an app where user touch the screen and places a rectangle view on screen which he can move or resize by touching its corners like any other crop view . I have done this functionality but i want eight handlers on the sides of that rectangle so that user can use that handlers to resize it. Now i am unable to create such functionality . I tried to add eight buttons as subview on that rectangle view but when resizing when that view increase its size than all eight buttons just change their positions . can anybody help me with this functionality ?
Thanks in advance
Hi i got the answer from here . here is a great class for making resizable view. Great work by the developer
Create resizable view in ios with UITouch
To do this you are going the right way about it.
You need to create a custom view that positions these eight handles depending on the size of the view. When the view changes size you then need to reassess where those handles are so maybe have a function thats called when the view is resized and in here you change the location of each handle just by changing its x and y origin depending on the view size.

How to diable horizontal scrolling of uitable view? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Disable UITableView horizontal scroll
Please can any one tell me how to disable horizontal scrolling of tableview..
Kindly help..
If your tablecontentview width is same as your view width it will not scroll in horizontal way but if you want that your tableview should not bounce then you can disable bouncing of your tableview as
m_TableView.bounces = NO;