CS193P - Lecture 8 pptx

64 183 0
CS193P - Lecture 8 pptx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

CS193P - Lecture iPhone Application Development Scroll Views & Table Views Announcements ¢ Presence due tomorrow (4/28) = Questions? ¢ Presence due next Tuesday (5/5) Announcements ¢ Enrolled students who requested iPod touches can pick them up after class today = Need Student ID = No grade if not returned! Today's Topics ¢ Scroll views ¢ Table views = Displaying data = Controlling appearance & behavior ¢ UlTableViewController ¢ Table view cells ¢ Presence - Part Scroll Views UIScrollView ¢ For displaying more content than can fit on the screen ¢ Handles gestures for panning and zooming ¢ Noteworthy subclasses: UlTableView and UlTextView Scrolling Examples Carrier 8:52 Hello C 51IPM = F = Zurich 2:91 am mm AT&T => 8:43 PM :10 AM [Tomorrow | Today ah This is just _ Something _| typed _ For the lecture slides Healdsburg g: 51 au 98° ` m Hello CS193P! [omorro Sứ the Conchords pportunity On Debra (Du World Clock mm ww Alarm Stopwatch sa © = ate | gsness' First Fi (& Artists Albums Podcasts More Using a Scroll View ¢ Create with the desired frame CGRect frame = CGRectMake(0, @, 200, 200); scroLLView = [[UIScrolLView alloc] initWithFrame: frame ]; ¢ Add subviews (frames may extend beyond scroll view frame) frame = CGRectMake(0, myImageView [scroLLView 0, 500, = [[UIImageView 500); alloc] addSubview:myImageView]; initWithFrame: frame]; ¢ Set the content size scroLLView contentSize = CGSizeMake(50@, 500); Frame and Content scroLLView frame Frame and Content scroLLVtew.contentS1ze ... Carrier 8: 52 Hello C 51IPM = F = Zurich 2:91 am mm AT&T => 8: 43 PM :10 AM [Tomorrow | Today ah This is just _ Something _| typed _ For the lecture slides Healdsburg g: 51 au 98? ? ` m Hello CS193P! ... behavior ¢ Issues with this approach - Application logic and behavior is now part of a View class = Tedious to write a one-off subclass for every scroll view instance - Your code becomes tightly coupled... behavior - Customize appearance * Loosely coupled with the object being extended UIScrollView Delegate @protocol UIScrolLViewDeLegate @optional // Respond to interesting events - (void)scroLlLViewDidScroLlL:CUIScroLlLView

Ngày đăng: 12/07/2014, 12:20

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan