これを使うと、こんな感じの「次へボタン」や「戻るボタン」
が作れます。

次の attribute を指定します。
android:drawableLeft="@drawable/icn_left"
android:drawableRight="@drawable/icn_right"
android:drawableTop="@drawable/icn_top"
android:drawableBottom="@drawable/icn_bottom"
いろいろ並べてみました。

drawable の場所は縁から一定で、width が変わると文字との距離が変わる。
padding を設定すると、drawable と縁との距離が変わる。
android:drawablePadding を使ってできました!
kuriyama さんありがとうございます~。
android:drawablePadding="10dip"
のように使います。

xml はこちら
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button"
- android:drawableLeft="@drawable/stat_sys_phone_call_forward"
- android:drawableRight="@drawable/stat_sys_phone_call_bluetooth"
- android:drawableTop="@drawable/stat_sys_phone_call"
- android:drawableBottom="@drawable/stat_sys_phone_call_on_hold"
- />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text= 'android:padding="20dip"'
- />
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button"
- android:drawableLeft="@drawable/stat_sys_phone_call_forward"
- android:drawableRight="@drawable/stat_sys_phone_call_bluetooth"
- android:drawableTop="@drawable/stat_sys_phone_call"
- android:drawableBottom="@drawable/stat_sys_phone_call_on_hold"
- android:padding="20dip"
- />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text= 'android:layout_weight="1"'
- />
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <Button
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:drawableLeft="@drawable/stat_sys_phone_call_forward"
- android:text="Button"
- />
- <Button
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:drawableRight="@drawable/stat_sys_phone_call_bluetooth"
- android:text="Button"
- />
- </LinearLayout>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text= 'android:layout_width="wrap_content"'
- />
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableLeft="@drawable/stat_sys_phone_call_forward"
- android:text="Button"
- />
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableRight="@drawable/stat_sys_phone_call_bluetooth"
- android:text="Button"
- />
- </LinearLayout>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text= 'android:layout_width="150dip"'
- />
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <Button
- android:layout_width="150dip"
- android:layout_height="wrap_content"
- android:drawableLeft="@drawable/stat_sys_phone_call_forward"
- android:text="Button"
- />
- <Button
- android:layout_width="150dip"
- android:layout_height="wrap_content"
- android:drawableRight="@drawable/stat_sys_phone_call_bluetooth"
- android:text="Button"
- />
- </LinearLayout>
- </LinearLayout>
>文字と drawable の間を設定することはできないみたい
返信削除android:drawablePaddingでできると思います♪
情報ありがとうございます!
返信削除eipapaと申します
返信削除私が入手したiPhone 4にそっくりなAndroid端末にはハード的な「BACKキー」や「NEXTキー」がありません上記のようなアプリやウィジットはないでしょうか?