Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Community Center > Ad Hoc Beta Testing

Reply
 
LinkBack Thread Tools Display Modes
Old 07-25-2011, 12:14 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 5
dimensionequis is on a distinguished road
Default Put a Button CGRECT Help

I have this code below, but the button only appears behind the image and just in the first image, how I can put the button over the all images?
HTML Code:
- (void)loadView 
{    
    // Step 1: make the outer paging scroll view
	
	CGRect frame = CGRectMake(10, 70, 300, 50);	
    UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    button.frame = frame;	
    [button setTitle:@"Click Me, Please!" forState:UIControlStateNormal];
    button.backgroundColor = [UIColor clearColor];
    button.tag = 2000;
    [button addTarget:self
               action:@selector(buttonClicked:)
     forControlEvents:UIControlEventTouchUpInside];
	
    CGRect pagingScrollViewFrame = [self frameForPagingScrollView];
    pagingScrollView = [[UIScrollView alloc] initWithFrame:pagingScrollViewFrame];
    pagingScrollView.pagingEnabled = YES;
    pagingScrollView.backgroundColor = [UIColor blackColor];
    pagingScrollView.showsVerticalScrollIndicator = NO;
    pagingScrollView.showsHorizontalScrollIndicator = NO;
    pagingScrollView.contentSize = CGSizeMake(pagingScrollViewFrame.size.width * [self pdfPageCount],
    
											  pagingScrollViewFrame.size.height);

	[pagingScrollView addSubview:button];
    pagingScrollView.delegate = self;
    self.view = pagingScrollView;
    
    // Step 2: prepare to tile content
    recycledPages = [[NSMutableSet alloc] init];
    visiblePages  = [[NSMutableSet alloc] init];
    [self tilePages];
}
dimensionequis is offline   Reply With Quote
Old 10-18-2011, 09:20 PM   #2 (permalink)
Registered Member
 
newDev's Avatar
 
Join Date: Jul 2010
Location: Utah
Posts: 73
newDev is on a distinguished road
Default

i think you can exchange the index of the view with the index of the button.
Something like exchangeobjectatindex withobjectatindex.
__________________
Sir Charles Barkley
newDev is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 175,640
Threads: 94,104
Posts: 402,839
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jasonwhf2
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:48 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0