
<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:ID="@+ID/relativeLayout1"androID:layout_wIDth="fill_parent"androID:layout_height="fill_parent"androID:background="@drawable/bg2x" ><linearLayout androID:ID="@+ID/linear" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content" androID:orIEntation="vertical" androID:gravity="center" androID:layout_alignParenttop="true" androID:background="#FF00FF00" > <TextVIEw androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content" androID:textcolor="#FF000000" androID:textSize="70dp" androID:text="test linearlayout" /></linearLayout>
现在我想把“线性”布局旋转90度. *我不想使用动画*,有没有其他的方法来取得这个?
请帮助我.谢谢提前!
androID:rotation = "90"
以XML本身旋转.如果你想在代码中做,按一下按钮后,就可以使用它的java等价
yourLayout = (linearLayout) findVIEwByID(R.ID.your_ID); yourLayout.setRotation(90.0f);
但不在API 11之前.参见documentation.
androID:rotation
rotation of the vIEw,in degrees.
Must be a floating point value,such as “1.2”.
This may also be a reference to a resource (in the form
“@[package:]type:name”) or theme attribute (in the form
“?[package:][type:]name”) containing a value of this type.This corresponds to the global attribute resource symbol rotation.
编辑:看完评论后
yeah,I kNow this method in API level 11. But what about lower API
level?
我想你可以自己旋转视图.而且我相信,在this线上,lchorus和Pete的答案是有效的.对于皮特的回答,他正在使用动画,但您可以设置动画持续时间为0,无需任何可见动画.据我所知,没有其他直接的方式
总结以上是内存溢出为你收集整理的java – Android:如何旋转LinearLayout全部内容,希望文章能够帮你解决java – Android:如何旋转LinearLayout所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)