Questions tagged [addsubview]

Questions relating to the addSubView method of the Apple UIView class

Questions relating to the addSubView method of the Apple UIView class

540 questions
3
votes
1 answer

Xcode - UILabel is not changing value on viewDidAppear

Hey everyone, I have a iPhone App I am creating. It uses a uitableview and that goes to a detail view. Now on the detail view I have a scroll view, and all the data (XML) comes into it fine, each time, no issues. My UILabels in my scrollview do…
fatwombat
  • 43
  • 2
  • 8
3
votes
1 answer

How to removeFromSuperview() with a transition

I have added a view as sub view using the following code let controller = SideMenuViewController.instantiateViewControllerFromStoryboard(storyBoardName: "Module1") as! SideMenuViewController UIView.animate(withDuration:0.5, delay: 0.0,…
user7887716
3
votes
3 answers

Adding an overlay view to UICollectionViewCell - keeps overlaying

I'm trying to add a 50% black alpha view on every collection view cell. The collection view cells have a background photograph and text on top. Would like the overlay view to be in between the two. In my cellForItemAt method, I use the…
Joe
  • 3,772
  • 3
  • 33
  • 64
3
votes
1 answer

Add a subview with constraints do not work

I want to add a subview with some constraints. But my view do not appear. Below is some code, does anyone know what is going wrong? (If i add a UITextField e.g. it works fine...) class TestViewController:UIViewController { override func…
Oliver
  • 1,458
  • 1
  • 12
  • 12
3
votes
1 answer

How to add a Subview using [self.view addSubview: myView] where myView is subclass of UIView?

In my Project, I have a customised @interface GraphView: UIView. Hence GraphView is a subclass of UIView and is meant to show a graph. Then, I create a new View Controller called Summary using a NIB. In the Interface builder, I just add a UIToolbar…
Keith
  • 43
  • 3
  • 9
3
votes
2 answers

UITableView as a subview?

Is this possible? I just want a small table in my current view... here is what I'm trying to do: .h file #import @interface IngredientsRootView : UIViewController { UITableView…
Thomas Clayson
  • 29,657
  • 26
  • 147
  • 224
3
votes
3 answers

UIButton isn't active

I started to study iOS programming with a book by Aaron Hillegass, and I have found that some samples do not work. Maybe they do not work because there is a new version of iOS and Xcode. Could you explain to me why this code is not working? The…
gurk
  • 45
  • 5
3
votes
2 answers

Add subview to a custom class

I have a UITextField that I want to create a custom class on. So I created a file with a subclass of UITextField. Next, in the custom class, I want to implement a tableView. Kind of like a auto-complete textField. I started creating it, and added…
Jessica
  • 9,379
  • 14
  • 65
  • 136
3
votes
1 answer

UIViewController remove subview

I add a view as subview of my uiviewcontroller like this: // into my ViewController: UIImageView *imView =[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"img.jpg"]]; imView.frame = CGRectMake(2, 46, 1020, 720); [self.view…
ghiboz
  • 7,863
  • 21
  • 85
  • 131
3
votes
6 answers

Add a UITableView to an existing ViewController

I'm trying to add a UITableView to an existing UIViewController programmatically. My run.h file has this: @interface runTests : UIViewController…
Dan
  • 2,304
  • 6
  • 42
  • 69
3
votes
1 answer

ios 8 addSubview causes a black screen in background

This is quite a strange behaviour and I couldn't figure what was wrong out. In iOS7, this code below works as expected but in iOS 8, it has a strange behaviour. UIView *mainPopupView = [[UIView alloc] initWithFrame:CGRectMake(10, ([UIScreen…
Merkurial
  • 242
  • 3
  • 17
3
votes
1 answer

iOS View gets reset on addSubview

I have a storyboard with a square imageView in the middle at: 280,140 (vertical) When the application starts i am able to move this imageView by pressing buttons. I move the imageView using: _mainImage.frame =…
Cupple Kay
  • 155
  • 2
  • 14
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
2 answers

Bring previously added view to front

My problem is the following: I have a view and to that view I add 3 subViews(view1,view2,view3) in that order. The views slightly overlap. I want to bring the first view to the top but I just can't get it to work. I tried adding the views with…
Busu
  • 263
  • 3
  • 12
3
votes
2 answers

iOS who is file owner of subview?

I am newbie in iOS development and I have a problem to understand file owner logic. I have this situations: I have two views (View_iPad, View_iPhone) and their controllers (ViewController_iPad, ViewController_iPhone). Based on a device where app is…
DanielH
  • 953
  • 10
  • 30