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
4
votes
2 answers

Buttons are not working after adding as subviews to background image

I have a working login Viewcontroller but when I added a background image the functionality of buttons are not working, there is no syntax error. When I added as just background image every button works fine but when I added buttons as subviews the…
iOS Developer
  • 311
  • 4
  • 25
4
votes
2 answers

UIView subviews' order?

If i use a for loop; for(UIView *subview in [myView subviews]) in which order, subviews are brought? According to their added order or something else?
erdemgc
  • 1,701
  • 3
  • 23
  • 43
3
votes
3 answers

NSArray remove last object of type?

Working with an array of UIViews and UIImageViews ([[[UIApplication sharedApplication] window] subviews]). I need to remove only the object of the highest index of the UIImageView type.
Kyle
  • 1,662
  • 2
  • 21
  • 38
3
votes
2 answers

Remove subviews with tags safely

This is not a real problem, i want just a clarification. I'm adding some subviews on a UIButton(each button has a tag), i know that there may be either 4 or 5 subviews. So, when i want to remove some subviews(specifically the 4th and 5th in this…
Mat
  • 7,613
  • 4
  • 40
  • 56
3
votes
0 answers

How to remove a Container View Controller along with its child view controllers

TLDR: I would like to ensure that my remove code removes the Container View and UIViewController A, B, and C. Any help is greatly appreciated. My application has a container view which adds a container view programmatically. The view in the…
DevC
  • 6,982
  • 9
  • 45
  • 80
3
votes
2 answers

Calculating dynamically the height of a custom UITableViewCell

I am building a application without the IB and I am writing everything from scratch. I have a custom UITableViewCell and when I try to calculate the height, it behaves like there are no subviews. I could find a lot of discussion about dynamically…
3
votes
2 answers

Remove UIView from UIScrollView in XAMARIN

i have several controls (subclasses of UIView) placed on a UIScrollView. Now I want to remove them from the UISrollView and create new controls. The code below runs but has no effect! What am i doing wrong? for (int i = 0; i <…
Klaus Grosche
  • 85
  • 1
  • 7
3
votes
1 answer

iOS - Interface Builder - bind multiple view inside the same xib

I'm trying to organize a complex xib into multiple view. Suppose the following scenario: I have the main view (the green one) that contains two subviews (the red and the yellow ones). Actually I can create three xib and add the subviews…
Yusef Maali
  • 2,201
  • 2
  • 23
  • 29
3
votes
1 answer

Shadow in UIView without gradient ?

Does any one know how to achieve the shadow effect with no gradient? Like the screenshot show below Another concern is the sequence of subviews, i.e the view in front may hide the effect of the view in behind. How to overcome this?
Js Lim
  • 3,625
  • 6
  • 42
  • 80
3
votes
2 answers

UITableView becomes unresponsive

UITableViewCell becomes unresponsive this was a very different problem with a very different solution. My tableView which is a subView in a UIViewController initially works fine and I can select individual rows in the table. However, I have created…
Rambatino
  • 4,716
  • 1
  • 33
  • 56
3
votes
2 answers

Why iOS cannot get subviews property for class UIView using class_getProperty function?

I want to get the information about subviews property of class UIView: objc_property_t property = class_getProperty([UIView class], "subviews"); But, it returns nil? I think it is so strange. Could someone explain this behavior to me?
boyal
  • 353
  • 4
  • 7
3
votes
0 answers

Enable user interaction with UINavigationBar subviews that extend past the bounds of the bar

I have custom views and buttons that I have added as subviews of my UINavigationBar. Their frames are set such that they begin halfway down the nav bar and extend past the normal bounds of the nav bar. I also have another subview that from time to…
iOS4Life
  • 226
  • 2
  • 13
2
votes
1 answer

iOS: issues with UIGestureRecognisers vs Subviews

I have written following code to attach gesture recogniser to multiple imageviews. [imageview1 setUserInteractionEnabled:YES]; [imageview1 setMultipleTouchEnabled:YES]; [imageview2 setUserInteractionEnabled:YES]; [imageview2…
Paresh Masani
  • 7,474
  • 12
  • 73
  • 139
2
votes
1 answer

NSView resizing shaky

I have an MAAttachedWindow (subclass of NSWindow), which contains a blank view (contentView), and some arbitrary subview (right now an NSImageView). On load, I'm attempting to resize the window by 100px vertically, in an animated fashion. This code…
Patrick Perini
  • 22,555
  • 12
  • 59
  • 88
2
votes
1 answer

NSView and loading subviews on the fly

To get a sense of what I'm doing without posting pages of code... I have an NSOperation that I'm using to process files as they are added to a folder. In that NSOperation I'm using the NSNotificationCenter to send notifications to an NSView whenever…
Kris
  • 349
  • 1
  • 2
  • 13
1
2
3
12 13