租用问题

质量为本、客户为根、勇于拼搏、务实创新

< 返回租用问题列表

Android按钮间距如何设置,android按钮形状

发布时间:2023-08-16 07:51:59

Android按钮间距如何设置

您可使用android:layout_margin属性来设置Android按钮之间的间距。
例如,以下是一个按钮布局,其中包括两个按钮,它们之间有10dp的间距:
```xml
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按钮1"
android:layout_marginEnd="10dp"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按钮2"/>

```
在这个例子中,通过在第一个按钮上设置`android:layout_marginEnd="10dp"`,在按钮之间创建了10dp的间距。您可以根据需要调剂间距的大小。