Questions tagged [subview]

subview is an abstract representation of a nested hierarchy of views in a MVC framework

A subview can be defined either explicitly as a separate class, or implicitly via object composition, depending on the framework.

References

1264 questions
10
votes
1 answer

iPhone subview flip between 2 views

iPhone / Objective-C On my view a little "hover" view appears after a user clicks on a button on the main view. When the user clicks this subview I want the subview to FlipFromRight to another view (same size). The main view underneath should…
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
9
votes
2 answers

How to make a subview fill its superview

I can't find the answer here anyway, nor do I see a duplicate question. My code is simple. Given 3 UIView, parent, from and to, remove from from parent and add subview. + add animation but that's just doodads. Now, the problem is when I do that, the…
user4951
  • 32,206
  • 53
  • 172
  • 282
9
votes
4 answers

iphone - determine if touch occurred in subview of a uiview

In a subclass of UIView I have this: -(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { if(touch occurred in a subview){ return YES; } return NO; } What can I put in the if statement? I want to…
sol
  • 6,402
  • 13
  • 47
  • 57
9
votes
2 answers

Make a view (initialized from initWithNibName) load all its subview

Assuming I load a view controller from a nib, and decide to do something with one of its subview behind the scene. At a later moment in time, I would show the view of this view controller. viewController = [[MyViewController alloc]…
iamj4de
  • 780
  • 1
  • 6
  • 18
9
votes
1 answer

Removing and re-adding a subview with autolayout

When using autolayout, my understanding is that removing a subview ( while holding a reference to it of course), the removed subview still knows its autolayout constraints. However, when adding it back to the super view later, the subview no longer…
uchuugaka
  • 12,679
  • 6
  • 37
  • 55
9
votes
1 answer

UserInteraction enable for subview only

I have a view and view.UserInteractionenabled = no and a button is added to the view. i need to click the button only . is it possible to enable interaction for button only.
Vishnu
  • 208
  • 5
  • 19
8
votes
2 answers

Parent view navigationController

I have a view which is a part of a tabBarController. In this view I have a subview with a table. When clicking a cell in this table, I would like to access the navigationController of the parent view. Is this possible - and if so, how? I thought it…
simonbs
  • 7,932
  • 13
  • 69
  • 115
8
votes
1 answer

Horizontal Stack View New Row - Swift

Stack Views's in iOS are a beautiful thing but I have realized there is no native way to create new rows in horizontal stack views. Let's say I dynamically added subviews in a horiztonal stack view and would want to create a new row once I reach an…
theflarenet
  • 642
  • 2
  • 13
  • 27
8
votes
4 answers

How to add subview to a webview so that the subview would scroll along with webview?

I have webview. Now I want to add a subview to it. I added it using addsubview method. The view got added, but did not scrolled with webview. I want my subview to be scrolled with the webview. How can I do that? Regards, Akshay.
Akshay Shah
  • 81
  • 1
  • 2
8
votes
7 answers

UIWebview won't zoom even after setting scalesPageToFit to YES

I have a UIWebview that is loaded as a subview when a user selects a tab on a UISegmentedControl. For some reason, I can not get it to allow pinch/zooming. I set the following code in the viewDidLoad: method, so it should work. self.myWebView =…
Jonah
  • 4,810
  • 14
  • 63
  • 76
8
votes
3 answers

Views within custom UICollectionViewCell not receiving touch events

I have a UICollectionView which supports horizontal and vertical scrolling. Each collection view cell is a subclass of UICollectionViewCell and they are loaded from a NIB that contains UIButton's, UITableView's and even another UICollectionView.…
patschiboy
  • 1,091
  • 8
  • 21
8
votes
4 answers

Can you limit UIView Clip Subviews to certain sides of a view?

I have a UIScrollView that contains other subviews that are partially drawn outside of the scrollview. These views extend vertically above the scrollview. Is it possible to only allow the subviews to be drawn outside the top of the scrollview, and…
Justin Moore
  • 884
  • 2
  • 9
  • 22
8
votes
1 answer

Determining if a point in a view is within a subviews bounds

Suppose I have a UIView parentView and a subview childView that is rotated at some unknown angle relative to parentView. What is the most efficient way to determine if a point within parentView (I know the coordinates in parentView's coordinate…
Victor Engel
  • 2,037
  • 2
  • 25
  • 46
8
votes
4 answers

How to check if subview is button or not

I am developing an application. In that I get all subviews of UITableViewCell. The code for this one is: (void)listSubviewsOfView:(UIView *)view { // Get the subviews of the view NSArray *subviews = [view subviews]; // Return…
Venkat1282
  • 113
  • 1
  • 6
7
votes
2 answers

Animating UIView frame size change with autoresizing subviews

I have a UIView which contains two subviews. I would like to change the superview's frame size with an animation and have the subviews' sizes change in accordance with their autoresize masks. [UIView beginAnimations:@"Resize" context:nil]; [UIView…
jjoelson
  • 5,771
  • 5
  • 31
  • 51