float:left in objective-c [英] float:left in objective-c

查看:102
本文介绍了float:left in objective-c的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让一堆按钮的行为有点像float:left in CSS。
因此,无论何时视图更改大小,例如,在方向更改时,按钮都应该进行调整,使其适合容器视图。

I'm trying to make a bunch of buttons behave somewhat like float:left in CSS. So whenever the view changes size, on orientation change for example, the buttons should adjust so they fit within their container view.

在横向模式下,此UIScrollView

In landscape mode, this UIScrollView should scroll horizontally, in portrait mode, it should scroll vertically.

我试图使一个ScrollView类似于iPad YouTube应用程序中的精选标签,在纵向模式下,它应该垂直滚动。横向有4列,纵向:3列,订阅标签,纵向,同一视图有2列。

I'm trying to make an ScrollView similar to the "Featured" tab in the iPad YouTube app. Landscape has 4 columns, portrait: 3 columns, "Subscriptions" tab, portrait, the same view has 2 columns.

推荐答案

https://github.com/jweinberg/JWLayoutViews/blob/master/Classes/JWWrapLayoutView.m =nofollow>布局系统来做这样的事情。有一个演示项目如何使用它检入该存储库。我很乐意回答任何关于它的问题。这比AQGridView轻得多,所以如果你不需要他提供的额外的功能,我会建议一种类似我的方法。

I have implemented a layout system to do things like this. There is a demo project on how to use it checked into that repository. I'd be happy to answer any questions about it. This is much more lightweight than AQGridView, so if you don't need the extra functionality he is providing, I would recommend an approach similar to mine.

这篇关于float:left in objective-c的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆