使用框架布局在android中设置按钮的文本

发布于 2024-12-01 08:49:17 字数 1121 浏览 4 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千と千尋 2024-12-08 08:49:17

您可以在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文