TAILIEUCHUNG - Phát triển ứng dụng cho iPhone và iPad - part 11

Tham khảo tài liệu 'phát triển ứng dụng cho iphone và ipad - part 11', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Customizing the TableView 69 Next you implement the method setProduct that is called from the custom cell - void setProduct Product inputProduct dmmloadon If a different product is passed in. if theProduct inputProduct Clean up the old product theProduct release theProduct inputProduct Hang on to the new product theProduct retain Mark the view to be redrawn self setNeedsDisplay This method does a couple of things. First it sets the product to be displayed and then it marks the view to be redrawn. You should never directly call the drawRect method to redraw a view. The proper way to trigger a redraw is to tell the framework that a view needs to be redrawn. The framework will then call drawRect for you when it is time to redraw. Implementing drawRect Now you get to the real meat of this example drawing the view. This is done in the drawRect function and is relatively straightforward 0- void drawRect CGRect rect Drawing code Available for download on Draw the product text drawAtPoint CGPointMake forWidth 120 withFont UIFont systemFontOfSize minFontSize actualFontSize NULL lineBreakMode UILineBreakModeTailTruncation baselineAdjustment UIBaselineAdjustmentAlignBaselines Set to draw in dark gray UlColor darkGrayColor set Draw the manufacturer label drawAtPoint CGPointMake forWidth 120 withFont UIFont systemFontOfSize minFontSize actualFontSize NULL 70 I CHAPTER 3 DISPLAYING YOUR DATA THE UITABLEVIEW lineBreakMode UILineBreakModeTailTruncation baselineAdjustment UIBaselineAdjustmentAlignBaselines Set to draw in black UIColor blackColor set Draw the price label NSNumber numberWithFloat stringValue drawAtPoint CGPointMake forWidth 60 withFont UIFont systemFontOfSize minFontSize actualFontSize NULL lineBreakMode UILineBreakModeTailTruncation baselineAdjustment UIBaselineAdjustmentAlignBaselines Draw the images NSString filePath .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.