View elements resize problem - iphone

I have a UiView which contains a UiWebview, UIButton and a UITextView as its elements.
I add this UiView to a UIScrollView and resize the frame so that the text view is not visible. When i click the button i resize the view to display the entire UIView including the UItextview.
The problem is , the text view appears below the view when i resize the frame. When i click expand it covers the text view too.
When view is first added i want the view to display just the webview and the button and when button is pressed it should display the text view.
How do i achieve it? Has it got to do with view hierachy?

you should enable clipping on the UIView .
edit:
I wouldn't resize the view. Instead I would just change the hidden-property on the textview. If you want to add some animations later then you can modify the alpha-property as well.

Related

only scroll half content UIScrollView Swift

in my app, I would apply Scrollview which there are textfields and labels.
but I was very confused, because some textfield can not be shown on the
scroll view and the textfield "country" and further textfield not selectable. scrol bar on scrolview Nor can slide all the way down, only half of the frame content view.
how so I can scroll through the entire content and can use existing textfield?
Image
If you have multiple subviews, you need to update the scroll view content size
I you use autolayout, you can follow this tutorial.

How to make a UIImageView display full screen (Swift)

I have a UIImageView in a UITableViewCell. When the image is tapped I want the image to display full screen and then when tapped again, to return to it's normal size. Do I need to create a new view for this? Thanks for any help
Yes, you have to create new view to show image in full screen.
First get frame of tapped image view with respect to self.view, then assign that frame to new view in which you have full imageView. Now with animation, show full image view, and again with tap back to its original frame with animation.
It's easiest if you create a new view. It's also easiest if you have a view controller with the table view as a subviews of the main view. Then you can create the new view as a sibling to the table, displayed over the top of the cell, and animate it's frame to full screen.

Making a Title scroll in a UIScrollView with the text below

I have a storyboard with a UIScrollView taking up the entire iPhone screen. I have a label at the top for the title, and then a textview below that which has text loaded into it from a .txt file. However when I scroll, it scrolls through the large body of text with the title staying put at the top of the view, even though the label is based in the scrollview rather than outside of it. Any ideas how I can fix this?
Thanks!
textView has its own scrolling method built in, so your textView will scroll independently of your scrollView. Create the title within the textView or set text view not to scroll in Interface builder and use your scrollView

Action sheet in an UIScrollview

I have a full screen UIScrollView to display my image. And the scroll view recognize long press gesture. After long pressing on the scrollview, an action sheet shows up. If i add the action sheet to the window, it will not rotate while I am rotating the screen. If i add it to the scroll view, it rotates but not that good when the scroll view has been zoomed or scrolled. Is it possible to rotate the action sheet well regardless of the scrolling and zooming of the scroll view?
ps. the scroll view is directly add to the window by "self.view = myScrollView;"
Adding the scrollView to the rootviewcontroller or the parent view on which scrollview resides would be better and solve you problem.

uiview and uiscrollview

i am creating a dropdown button in my app. Like a pop-up control which is available in webapps. so when i click on a button, a new UIView containing a UIPickerView appears. i user beginanimations and commitanimations for dispalying and hiding the UIView. the new uiview is half the size of the scrollview.
I want that whenever the new uiview appears, the size of the scrollview should alter so that the i can scroll through the entire view. something like, when a keyboard appears, we reassign the size of scrollview, so that we can scroll entire view.
So how will i know, when the uiview appears. Is there a notification for beginanimations and commitanimations like for keyboard (UIKeyboardDidHideNotification)
thnx in advance.
if the subview you create and show have a viewController, -(void)viewWillAppear method of the viewController will be called on every appearance of that view.
In that method, you can somehow get the superview (for example calling nextResponder method) and resize the superview according to your needs.
Hope that helps.