2012-01-30 5 views

答えて

1

レイアウトはどちらの方向でも機能します。このdocumentに従ってlayout-landscapeという名前のフォルダに同じ名前のxmlを追加することで、横向きのレイアウトを指定できます。あなたが向きの変更を処理しない場合、Androidがあなたのビューを再現できるように、向きが変更されたときにアプリケーションが正しく動作することを確認する必要があることに注意してください。

1

あなたのxmlにRelativeLayoutを使用します。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:background="@drawable/boxbig" android:orientation="vertical" 
android:layout_width="fill_parent" android:layout_height="fill_parent"> 

<Button android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_width="wrap_content" android:layout_height="wrap_content" 
    android:text="Bottom and Right" 
    /> 

</RelativeLayout> 
関連する問題