0

Androidのボタンに異なる幅を設定するにはどうすればよいですか?上と下のように2dpですが、左と右は4dpですか?ありがとうございました。

アップデート:

質問が不明な場合はお詫び申し上げます。マージンやパディングではありません。しかし、cssのborder-topやborder-leftのように幅をカスタマイズしたいと思います。Androidで可能ですか?

4

1 に答える 1

1

あなたの質問は明確ではありません.次のようなものを探していますか?

<Button 
android:text="Button"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" 
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:id="@+id/button1" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content">
</Button>
于 2011-08-09T10:09:43.653 に答える