scroll text and images please.

Member
Posts: 178
Joined: 2008.09
Post: #1
Hi. i have an small app with a lot of text and some pictures.
and I put a small button to change to a new view page
like show on the picture down here.....

[Image: iphone-button.jpg]

but my question is, how can I put a scroll bar, to have all the document together
and with the finguer scroll down, like show the other picture down here please ?
thanks a lot. !

[Image: iphone-scroll.jpg]

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #2
UIWebView automatically handles scrolling with your finger, so maybe you can use that if you're displaying rich content, as your diagrams suggest. Otherwise, UIScrollView.
Quote this message in a reply
Member
Posts: 254
Joined: 2005.10
Post: #3
Apple specifically says NOT to use a scroll bar. Don't do it as it takes up too much space, is hard to hit on the touch screen, and iPhone users are used to scrolling with-out one.

Of course there are no hard and fast rules.
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #4
let me explain a little bitmore:
this is not webpage, could be sometext with some pictures, or could be images.jpg

my point is, how can I change each page (text+picture) with fingers please ?
your help is to valuable for me.

thanks one more time !

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #5
Use UIScrollView if you need to scroll with finger and do not wish to use UIWebView.

I use UIWebView for rich text (text+picture) locally from the hard drive (not from the Web). It is *really* easy, and goes something like this, assuming you have a UIWebView wired up in a nib:

Code:
@interface MyViewController : UIViewController
{
    NSString            *html;
    IBOutlet UIWebView    *webView;
}
@end

@implementation MyViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
    {
        NSString *filePath = [[NSBundle mainBundle] pathForResource:@"myRichText" ofType:@"html"];
        html = [[NSString stringWithContentsOfFile:filePath encoding:NSASCIIStringEncoding error:nil] retain];
    }
    return self;
}

- (void)viewWillAppear:(BOOL)animated
{    
    [webView loadHTMLString:html baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] resourcePath] isDirectory:YES]];
}

@end
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #6
thanks....
i have UIWebView, but is not working yet, i am still trying,

but i found a sample code from apple and retouch.
I can switch through the pages but born another small question

how can I apply xcode to press a butoon and change to ANOTHER GROUP OF 4 MORE PAGES
here on this code please ?

if you want to download and run with simulator.
here is the proyect.

http://www.1572-8.com/fotos/zzz-dev-foto..._forum.zip

thanks a lot

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #7
Depending on which button you push, it looks like you should be able to loop through each image and call removeFromSuperview for each one. Then reload your new set of images just like you load them the first time with addSubview.

I'm not sure I see why you have step 2 in there.
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #8
AnotherJake Wrote:I'm not sure I see why you have step 2 in there.

When i download it, this sample code already have inside, (step 2)
i just ignore because i dont need it, and is more complex for me.
I thought if I erase, maybe damage all the proyect. Ijust ignore it. jajajajijij

Now my problme is how make a second set of 4 images, and call again.
but i will try now. thanks a lot

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #9
I was trying again but let me remake the main question again....

how can I do, when press the button one: load a new view controller
with another set of images.

and if press the button 2, shows another 3rth set of images please.

4 + 4 + 4 = 12 images total. 3 sets, Handle with buttons please.?

here is the proyect with 12 images, (complete proyect)
and this is my email ( losfulanitos@gmail.com ) if you could send fixed please.
I appreciate a lot your help.

here is the proyect link.
http://www.1572-8.com/fotos/zzz-dev-foto...g_mau3.zip

thanks again.

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #10
I sent the changes, hope it helps. Smile
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #11
I only can say sincerely THANKS YOU !
i will download and retouch.

tell me:
do you have app on appstore to see it please ?

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #12
It really helped me a lot
now is working.

only every button can handdle the same number of images,
maybe later i will change this.

but for now its wonderfull

thanks one more time AnotherJake.
thanks this forum !

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #13
Glad it helped!

imaumac Wrote:do you have app on appstore to see it please ?

Not yet. Wink
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #14
can i put a button inside UIScrollView

if I drag abutton from library, gones to back,
I need to put a button on the UIScrollView (image3.jpg) .

how canI do please ?
thanks

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Change scroll text using xcode imaumac 3 4,273 Nov 29, 2008 03:53 PM
Last Post: imaumac
  2d smooth scroll Luzander 3 3,851 Jan 9, 2006 03:42 PM
Last Post: kelvin
  nasty tearing when I scroll in openGL Joseph Duchesne 3 3,173 Aug 15, 2004 10:30 PM
Last Post: arekkusu