开发者

set the text of a button in android using frame layout

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"
 开发者_如何学Python                   />

  </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!


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜