Re: iPhone Question: UIScrollView
Okay - how would I lay the buttons out in IB since IB doesn't allow one to do that? I'd essentially need to place all my buttons with code anyway, correct? I want a really big image with hotspots on it I can click (I'll use with UIButtons). On Tue, Jul 21, 2009 at 11:03 AM, Graham Cox wrote: > > On 22/07/2009, at 12:56 AM, Eric E. Dolecki wrote: > > Might it be okay to add buttons via code on top of a big image, and just >> handle button events that way instead of using a sep view? >> > > > No idea. But why do things in a weird way when a perfectly good supported > way already exists? > > If you add buttons to a view and that view is in a scrollview, and its > bounds is big enough it will scroll. The buttons will scroll around with it > if that's what you have in there. The buttons can be added in code or in IB, > and the main view can draw an image if you want. > > What was the question again? Seems to have strayed from the point. > > --Graham > > > > > -- http://ericd.net Interactive design and development ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPhone Question: UIScrollView
On Jul 21, 2009, at 7:34 AM, Eric E. Dolecki wrote: I'm a real noob when it comes to the UIScrollView. What I would like to do: I have a View that contains a UIScrollView. Instead of loading an image in there, what I would like to do is load in another view (say an image that's a lot wider than the portrait iPhone... which has button sprinkled throughout). So the idea is you could pan around the view, and click on points of interest in the image (using UIButtons or whatever). But I'm not quite sure how to set this up. I created a View XIB (no view controller) and put some stuff in there. NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:@"details" owner:self options:nil]; UIView *infoView = [nibViews objectAtIndex:0]; [myScrollView addSubview:infoView]; This works, but I can't make the view wider than the iPhone portrait. How should I handle this? Right. You aren't supposed to make views larger than the screen (at least according to the docs). I assume that is to keep the layer sizes reasonable. What you do is set the contentSize of the UIScrollView to be as large as you want. Then, in your delegate callbacks or UIScrollView subclass, you add/remove view tiles as needed to present a seamless view to the user. As tiles move offscreen you reuse them as new tiles on the opposite side. Apple has a very nice tiled image view sample from WWDC 09 available online. Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPhone Question: UIScrollView
On 22/07/2009, at 12:56 AM, Eric E. Dolecki wrote: Might it be okay to add buttons via code on top of a big image, and just handle button events that way instead of using a sep view? No idea. But why do things in a weird way when a perfectly good supported way already exists? If you add buttons to a view and that view is in a scrollview, and its bounds is big enough it will scroll. The buttons will scroll around with it if that's what you have in there. The buttons can be added in code or in IB, and the main view can draw an image if you want. What was the question again? Seems to have strayed from the point. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPhone Question: UIScrollView
Might it be okay to add buttons via code on top of a big image, and just handle button events that way instead of using a sep view? On Tue, Jul 21, 2009 at 10:41 AM, Graham Cox wrote: > > On 22/07/2009, at 12:34 AM, Eric E. Dolecki wrote: > > This works, but I can't make the view wider than the iPhone portrait. How >> should I handle this? >> > > > set the bounds rect of the infoView to what you want. If larger than what > will fit in the scroll view, it will be scrollable. > > --Graham > > > -- http://ericd.net Interactive design and development ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPhone Question: UIScrollView
On 22/07/2009, at 12:34 AM, Eric E. Dolecki wrote: This works, but I can't make the view wider than the iPhone portrait. How should I handle this? set the bounds rect of the infoView to what you want. If larger than what will fit in the scroll view, it will be scrollable. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
iPhone Question: UIScrollView
I'm a real noob when it comes to the UIScrollView. What I would like to do: I have a View that contains a UIScrollView. Instead of loading an image in there, what I would like to do is load in another view (say an image that's a lot wider than the portrait iPhone... which has button sprinkled throughout). So the idea is you could pan around the view, and click on points of interest in the image (using UIButtons or whatever). But I'm not quite sure how to set this up. I created a View XIB (no view controller) and put some stuff in there. NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:@"details" owner:self options:nil]; UIView *infoView = [nibViews objectAtIndex:0]; [myScrollView addSubview:infoView]; This works, but I can't make the view wider than the iPhone portrait. How should I handle this? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com