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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-12-2010, 04:27 PM   #1 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 5
jossblowing is on a distinguished road
Default Composite view - repurposing a UITableView?

Hi there all,
I'm looking for a bit of advice on how I might go about implementing the following:

I have basically a big block of text - above the text I want to place an image. I'm going to apply a bit of styling around the image - a background color and maybe some attribution text.

I would like the user to be able to scroll the complete view - text and image - as if they were one single entity.

I've been experimenting with a UIViewController, that has a number of sub-views. In short - a UITextView and a UIImageView, as well as a UIView (for the background styling).

The text scrolls - but everything else remains static.


-------


So my question is am I somewhere on the right lines - should I be looking at UIScrollView? Maybe I have my view controller adopt the UIScrollView protocol - and then everything inside it can scroll happily?

That seems sensible - but I thought maybe I could just 'repurpose' a UITableView... but that doesn't seem quite right.

Any advice would be super helpful - many thanks for anything you can give!
>>joss
jossblowing is offline   Reply With Quote
Old 05-12-2010, 04:49 PM   #2 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 5
jossblowing is on a distinguished road
Default

Or... is the UITextView there to allow editing of the text? So could I just use a UILabel instead? Might that make it easier to have it scroll within a UIScrollView ?
jossblowing is offline   Reply With Quote
Old 05-12-2010, 06:22 PM   #3 (permalink)
Registered Member
 
kerofrog's Avatar
 
Join Date: May 2010
Posts: 63
kerofrog is on a distinguished road
Default

An interesting bit of knowledge is that UITableView inherits from UIScrollView and is really just an Apple customized scroll view.

You definitely want to be using a scroll view and have your image view and label view added as subviews of the scroll view.

Cliff.
kerofrog is offline   Reply With Quote
Old 05-14-2010, 04:36 PM   #4 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 5
jossblowing is on a distinguished road
Default thanks!

That's great, thanks Cliff.

I went with a UIScrollView which contained a number of subviews, including a multiline UILabel - because I wasn't quite sure how I would subvert/delegate a UITextView's scrolling methods.

It works a treat.

A lot of this stuff is starting to make some sense - really helped by these insights by kind folks like yourself.

Many thanks again,
>>joss
jossblowing is offline   Reply With Quote
Old 05-15-2010, 04:00 AM   #5 (permalink)
Registered Member
 
kerofrog's Avatar
 
Join Date: May 2010
Posts: 63
kerofrog is on a distinguished road
Default

Don't be afraid to work with a UITextView. You can turn off user interaction using userInteractionEnabled = FALSE and you can turn off scrolling by using scrollEnabled = FALSE etc.... there are quite a few options.
kerofrog is offline   Reply With Quote
Reply

Bookmarks

Tags
scrolling, text, uiscrollview

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
» Online Users: 315
14 members and 301 guests
Abidullah, baja_yu, cgokey, Duncan C, Fstuff, gbenna, guusleijsten, jbro, mdpauley, n00b, newDev, pkIDSF, Sami Gh, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,648
Threads: 94,113
Posts: 402,877
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brandon6031
Powered by vBadvanced CMPS v3.1.0

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