开发者

Multiple subviews(slides?) inside one UIView? Point me at the right direction

开发者 https://www.devze.com 2023-02-16 02:04 出处:网络
I want a UIView, inside of it there should beseries of slides.Lets say 30 slides, every of those slides will print data from database but that is irrelevant here.

I want a UIView, inside of it there should be series of slides. Lets say 30 slides, every of those slides will print data from database but that is irrelevant here.

To make it clear: Home view-Plain UIView with UIButton. Pressing an UI开发者_如何学运维Button gets the first of 30 slides(every one will print, i dont know, 1-30 numbers). So, first view gets number 1 from db, second..you get the idea? Moving from slides should be done by an arrow, button, or something else.

What is the best way of doing this? I am thinking that having 30+ UIViews won't do the job.Maybe UIImageView, but i don't have 'images'?

Thanks in advance!


What you really want is a UIViewController with two subviews, call them A and B.

When showing slide 1 in subviewA , draw/setup slide2 into subviewB in the background.

User hits the button, you can reveal/bringToFront/animate the appearance of slideB. Now that subviewA is hidden, draw.setup slide3 into subviewA and repeat.


take a look at the TheElements sample code from apple. it demonstrate the use of navigationcontroller, tableview and tab bar controller. You probably just need a tableview with 30 rows in a navigationcontroller.

Link to sample code

0

精彩评论

暂无评论...
验证码 换一张
取 消