使用框架布局在android中设置按钮的文本
我在 android 中有一个应用程序,其中使用 FrameLayout
设置按钮的文本,如下所示:
<FrameLayout android:layout_width="fill_parent"
android:layout_toRightOf="@id/surface_camera"
android:layout_height="fill_parent">
<Button android:layout_width="match_parent"
android:id="@+id/btnPhoto"
android:layout_height="match_parent"/>
<TextView
android:layout_width="match_parent"
android:id="@+id/textview"
android:textColor="#000000"
android:textSize="20dip"
android:layout_gravity="center_horizontal|bottom"
android:layout_height="match_parent"
android:text="Take Photo"
/>
</FrameLayout>
结果如下所示: http://i53.tinypic.com/2ypgn0l.png
我想问的是进一步使用此 FrameLayout
我可以旋转此文本???...假设旋转 90 度...如果 YES
,如何旋转?谢谢!
I have an application in android in which I'm setting the text of a button using a FrameLayout
, something like:
<FrameLayout android:layout_width="fill_parent"
android:layout_toRightOf="@id/surface_camera"
android:layout_height="fill_parent">
<Button android:layout_width="match_parent"
android:id="@+id/btnPhoto"
android:layout_height="match_parent"/>
<TextView
android:layout_width="match_parent"
android:id="@+id/textview"
android:textColor="#000000"
android:textSize="20dip"
android:layout_gravity="center_horizontal|bottom"
android:layout_height="match_parent"
android:text="Take Photo"
/>
</FrameLayout>
And the result looks like this:
http://i53.tinypic.com/2ypgn0l.png
What I wanna ask is there any posibility that further more using this FrameLayout
I could rotate this text???...Let say with 90 degrees...And if YES
, how?Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 TextView 上使用 RotateAnimation,但如果您只是尝试在横向和纵向中使用不同的布局,请在不同的文件夹中指定不同的 xml。根据名称命名文件夹
http://developer.android.com/guide/topics/resources/providing -resources.html
上面的链接告诉您如何为不同的条件指定不同的资源。
You could use the RotateAnimation on the TextView but if you just trying to use a different layout in landscape and portrait, specify different xmls in different folders. name the folders according to
http://developer.android.com/guide/topics/resources/providing-resources.html
The above link tell how you can specify different resources for different conditions.