开发者

Filling a UIScrollView w/ PageControl within a view

I'm trying to create a paginated UIScrollView within a view that only scrolls horiz开发者_JAVA技巧ontally and is populated by labels. There are 4 labels and each label shows a string derived from a NSDate, with each one being linked to a PageControl to show which page the user is on.

I'm having a little trouble trying to figure this out based on sample code and other answers.

If I've already dragged out the dimensions on IB, do I still need to specify the frame and such?

Do I then have to create views with labels on them? Or can I simply create labels and populate the UIScrollView?

Is there any way to get the background of the UIScrollView transparent?


You can add UILabels directly to the scroll view as they are a subclass of UIView. If you have already specified the size and position of a view in IB, you do not need to do it again programmatically, although you may. myScrollView.backgroundColor = [UIColor clearColor]; will make your UIScrollView transparent.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜