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

Add subview using storyboard without external xib

I'm learning Objective-C. I have a problem with new storyboard feature. I would initialize a subview inside a main view with xib. Without using storyboard, I could do it using: controller = [[UIViewController alloc]initWithNibName:@"NibName"…
GuyFox
  • 151
  • 1
  • 1
  • 3
13
votes
4 answers

iPhone/iOS: Will there be called any method if a UIView is added as a subview

If I add a view as a subview like so [self.view addSubview:mySubview]; Will there be called any method on mySubview, that I could override to add some custom behavior?
Pascal Klein
  • 23,665
  • 24
  • 82
  • 119
12
votes
3 answers

addSubview beneath another UIView

I would like to be able to addSubview beneath another already existing UIView, how can I do that? I haven't been able to find anything on this.
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253
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
8
votes
4 answers

UIView addsubview after orientation change: Tell view to resize

I have a UIView as a XIB in Portrait mode. This view is added programmatically to the viewcontroller like this: NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"InputView" owner:self options:nil]; InputView *inputView =…
marimba
  • 3,116
  • 5
  • 26
  • 29
8
votes
2 answers

subview scroll is not working SWIFT

Goal: to make a viewcontroller have multiple pages and can be swapped through a segmented controller, pages content are scrollable vertically details: I made a pagviewcontroller and embedded it as a subview to main viewcontroller //add…
Engineeroholic
  • 607
  • 6
  • 21
8
votes
5 answers

getting an ad response. ErrorCode: 1

I am testing my application in device it is showing the error in debug logcat what is this error and how to solve this? The error is There was a problem getting an ad response. ErrorCode: 1 my xml code is
koteswara D K
  • 628
  • 2
  • 9
  • 19
7
votes
3 answers

adding a custom view to a alert view

i have a problem like this: i want to show a customized view inside a alert view. so i create a separate xib file and designed my interface.and implemented the class for it too.but when i apply below code,it gives me an error. this is the code : …
Darshana
  • 314
  • 2
  • 4
  • 22
7
votes
1 answer

How to add a subview to an ImageView in Android

I come from an iOS background. For some reason, I cannot figure out how to add a view to another view. I have two ImageViews that I am creating programatically as follows: ImageView imageView; ImageView imageHolder; Now, I want to do something like…
wiseindy
  • 19,434
  • 5
  • 27
  • 38
7
votes
3 answers

Get actual dimensions of iOS view

How would I get the actual dimensions of a view or subview that I'm controlling? For example: UIView *firstView = [[UIView alloc] initWithFrame:CGRectMake(0,0,200,100)]; [self addSubview:firstView]; UIButton *button = [[UIButton alloc]…
GeorgeBuckingham
  • 195
  • 1
  • 1
  • 10
6
votes
3 answers

Adding subview center of screen

I am trying to add a small icon in the center of my iPhone app screen. Below is the code I think should work, but it isn't centering it. The position regarding the width is fine, but the height is way off, about 100 pixels off? UIImage *pinMarker =…
jdog
  • 10,351
  • 29
  • 90
  • 165
6
votes
7 answers

Remove a view from one view and add it to another

I am trying to find all my views that are in the nib and add them to my content view. This is what I have, It successfully removes the view from self.view but it does not add it to self.contentView for (UIView *view in self.view.subviews) { if…
Gary Kagan
  • 139
  • 2
  • 7
5
votes
2 answers

PresentModalViewController or addsubview?

Hi I am writing an app in xcode 3.2.3. All I want to do is switch to another view but I am unsure of the best way to do this. I can do it either of these 2 ways... PreferencesViewController *screen = [[PreferencesViewController…
user157733
  • 569
  • 2
  • 12
  • 26
5
votes
2 answers

Adding a subview to UIButton

I'm trying to add a customBadge as a subview of a UIButton - this is my code so far - //msg count initiaition //CustomBadge *customBadge1 = [CustomBadge customBadgeWithString:@"2"]; CustomBadge *customBadge1 = [CustomBadge…
Dancer
  • 17,035
  • 38
  • 129
  • 206
5
votes
2 answers

UIPageViewController Traps All UITapGestureRecognizer Events

It's been a long day at the keyboard so I'm reaching out :-) I have a UIPageViewController in a typical implementation that basically follows Apple's standard template. I am trying to add an overlay that will allow the user to do things like touch a…
1
2
3
35 36