Questions tagged [subviews]

Use this tag for questions related to extracting/manipulating/removing subviews. Subviews are parts of the hierarchy of a view, like the UIView iOS class.

subviews means the views which are holding/added over a 'View'.

as stated in ( iOS ) What is superview and what is subviews

Users use this tag for questions regarding listing/extracting all the subviews of a View, removing/deleting subviews of a View, altering/disabling the functionality of a subview of a View, reordering the subviews of a View, etc. .

182 questions
1
vote
1 answer

Why is my ViewControllers view.subviews count incorrect?

My ViewController contains a label a button 4 imageviews 2 textfields Why is self.view.subviews only returning an array with 2 elements? Here is a screenshot of my Xcode project: Edit I made a new Viewcontroller containing a switch and a…
user3693797
1
vote
1 answer

Embedding subview in main view Swift

If you look at this image (I don't want to upload it, as it does not belong to me), you will see what appears to be a uiview inside the main uiview controller in the settings app of an iPad. My question is, how do I replicate this programatically?…
rocket101
  • 7,369
  • 11
  • 45
  • 64
1
vote
1 answer

Design pattern for single window with multiple views

I have a window which will contain multiple subviews. For example, at start-up the user will be presented a login screen and when the user presses 'Login' (and it succeeds) the window should be updated to a new view. Currently I have created a…
T'n'E
  • 598
  • 5
  • 17
1
vote
3 answers

UIScrollView: subview added but not showing up

I have a UIScrollView called scroller. It has subviews which are custom UIButtons..I try to print the number of subviews before and after adding like as follows NSLog(@"Adding %d b4 %d",buttonno, [[self.scroller subviews] count]); …
Ansel Zandegran
  • 636
  • 8
  • 18
1
vote
3 answers

UIView on top of UITableView

I have been developing an app in which I have a UIViewController, to which I have added a UITableView. Now I want to add a UIView on top of the tableview at a fixed position. I tried the following code, but the UIView scrolls along with the…
Neha Dangui
  • 597
  • 2
  • 13
  • 28
1
vote
1 answer

UIWindow doesn't updating subviews after addSubview

I'm adding a UIView as subview to current keyWindow and it shows fine. Then when I update the subviews (UILabel, UIButton, UIImageView etc...) it doesn't get update. I tried adding setNeedDisplay everywhere so it can update it but still no…
Idan Moshe
  • 1,675
  • 4
  • 28
  • 65
1
vote
2 answers

Calculating The Origin of UIButton Directly from the Self.view in iOS

My objects' hierarchy is as follows, Let's say the UIButton's object name is 'myButton'. Now, Is there any way to Calculate the origin(X Coordinate,Y Coordinate) of 'myButton' directly from self.view not by using any intermediate objects'…
Ashok
  • 5,585
  • 5
  • 52
  • 80
1
vote
1 answer

Looking for text in a list of UILabel in subviews

I try to access to the text of my UILabels in subviews for (UIView *myView in recognizer.view.subviews) { ... } How can I check the text of my UILabels found in this research? Thanks
1
vote
1 answer

C4 passing image between subclasses

I'm trying to pass an image between 2 different views that are added as subclasses to the MainCanvasController. the image seems to get passed (it is shown, when printed to the Console) but it doesn't display anything... this is how I try to receive…
suMi
  • 1,536
  • 1
  • 17
  • 30
1
vote
1 answer

C4 navigating back and forth between subviews

I feel silly again but I don't manage to navigate back and forth between the subviews of my project. I can add as many subviews as I want as long as it just goes forward, but as soon as I want to come back to one of the views previously visited I…
suMi
  • 1,536
  • 1
  • 17
  • 30
1
vote
1 answer

IOS: save subview with his touch and tap abilities

I am trying to make a free drawing app, that when the user is drawing a circle on screen i alloc/init a UIview circle class and add it as a sub view. then i can move this circle that was created around the screen and tap it to change the color…
Am2710
  • 79
  • 1
  • 9
1
vote
1 answer

UITableview cell subview larger height then cell

@All Hello Its quite interesting problem i have. Actually i have subviews which can be larger in height then cell height itself (Its required for my design). For example cell "A" height is 40 while subview height= 70. I can show larger subview but…
Mann
  • 5,477
  • 6
  • 45
  • 57
1
vote
3 answers

Add UIPinchGestureRecognizer on main view and detect touch on subviews

I added some subviews (UITextView) on main UIView ([self view]) to scale/pinch and dragging them around the screen. Everything works fine for ONE subview with a tag (mytextview1.tag = 1). But how to tell the UIPinchGestureRecognizer that there is…
1
vote
2 answers

Changing the framesize of uiview with animation not changing the framesize of subviews automatically

i am working to animate a uiview(parent view named 'popupVw') which contains 11 subviews (7 buttons,2 labels,2 imageview). Initially the the frame size is : CGRect Frame = CGRectMake(10, 10 ,320, 0); & new frame size is: CGRect newFrame =…
stackNeverFlow
  • 203
  • 4
  • 16
1
vote
5 answers

Random EXC_BAD_ACCESS when adding subview with ARC

My app is working perfectly on the simulator but when I test the app on the device I eventually get a random EXC_BAD_ACCESS and the app crashes. After a few days of testing I think I have found the code that is causing this error. At some point I…