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. .

184 questions
46
votes
5 answers

Remove all the subviews from a UIScrollView?

How do I remove all of the subviews from a UIScrollview?
Moshe
  • 55,729
  • 73
  • 263
  • 420
28
votes
1 answer

Autolayout and subviews

I am using the iAd suite with storyboards from Apple, as per this link... Apple iAd Storyboard documentation It all works fine until I turn autolayout on. It builds fine but crashes on running. The output I get is: 2013-08-24 12:06:36.138…
Kevin Tarr
  • 387
  • 3
  • 9
14
votes
2 answers

iOS >> Dragged View is Jumping Back to Original Position >> Auto Layout Combined with UIPanGestureRecognizer Issue

I have several UIViews that the user should be able to drag & drop. I use UIPanGestureRecognizer to manage the d&d action (see code below). The d&d action is working fine, but when I start dragging another UIView, the one that I just dropped is…
Ohad Regev
  • 5,521
  • 12
  • 58
  • 82
13
votes
2 answers

xcode Removing Some Subviews from view

Greetings all, I am a noob and I have been trying to work through this for a few days. I am adding images to a view via UItouch. The view contains a background on top of which the new images are add. How do I clear the images I am adding from the…
S. Naughton
  • 131
  • 1
  • 1
  • 5
12
votes
12 answers

How to disable "highlight subviews" message for UIView/UIViewController in iOS SDK?

I want to use the default highlight on a UITableViewCell when it is tapped. However, I do not want custom subviews (and their subviews) to receive the message to update their highlighted states and therefore disrupt the backgroundColor property.…
Jacob Barnard
  • 1,285
  • 1
  • 11
  • 23
10
votes
4 answers

Reordering UIView subviews

In my app I am trying bring a subview to front, then put it back to its original layer position later. The code should be pretty simple: To bring the subview to front (inside my custom UIView class): [self.superview bringSubviewToFront:self]; Easy.…
eric.mitchell
  • 8,501
  • 12
  • 50
  • 91
9
votes
3 answers

Swift - Retrieving subviews

In my application I am adding labels to the view and then I am attempting to clear particular labels from the view when a button is clicked and am running into an error when trying to retrieve the subviews: class FirstViewController:…
user2961953
  • 157
  • 1
  • 2
  • 6
7
votes
4 answers

Change NSView subviews order

I'm working at a custom control that presents different handles. I want to be sure that the selected handle has a Z-index grater then the others handles. Is there a way to swap view order? I found this function sortSubviewsUsingFunction:context:…
MatterGoal
  • 14,512
  • 16
  • 95
  • 175
7
votes
4 answers

how to get all UILabels within a UIView

I need a way to get all UILabels within a UIView without having to go through all the views within the UIView. I have many other type of views, UIButtons, UIImageViews and it would be too long to go through all of them when I just need the…
subharb
  • 3,032
  • 8
  • 34
  • 66
6
votes
1 answer

Reusable HTML snippets and sub-views in web2py

I have some reusable HTML snippets that I want to 'include' in a number of web2py views. Using components with LOAD means having to write separate controller functions which need to load their own data. Is there a way to: Reuse dumb (no data) html…
Yarin
  • 144,097
  • 139
  • 361
  • 489
6
votes
4 answers

How to remove only user-added subviews from my UIView

I'm trying to remove all the subviews that I've added to my view, so I've implemented a loop to iterate over the subviews with the following: for subview in view.subviews { println(subview) //subview.removeFromSuperview() } I tested this by…
Epsilon
  • 1,076
  • 1
  • 6
  • 13
5
votes
1 answer

Autolayout how to support the substitution of a subview?

My problem is related to the use of autolayout (the famous) ;) I would like to manage 2 situations of subviews in the same view controller so that I can go from one situation to another (and reciprocally). Let me introduce the problem with the…
helper
  • 115
  • 9
4
votes
1 answer

Re-using Android layouts

On an iphone context, when we add a view as a subview of another view, anything that happens to our subview will be handled correctly, because in the xib we say which class will be handling its actions. How can we achieve this on android? Since we…
Rui Peres
  • 25,185
  • 9
  • 81
  • 132
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
  • 3
  • 23
4
votes
1 answer

"Magic Move" Effect Custom Transition

I trying to get a custom transition between two View Controllers. First, here's a picture to illustrate what I want : I want a UICollectionViewCell to expand to the whole screen. In this cell, the subviews are placed with Autolayout in IB. I just…
Coconuts
  • 801
  • 8
  • 29
1
2 3
12 13