làm thế nào để thêm đệm giữa các mục menu trong Android?
Tôi đang có các mục menu được tăng từ res/menu/menu.xml đến ActionBar, làm cách nào để thêm đệm giữa các mục menu bằng android?
<item
android:id="@+id/home"
android:showAsAction="always"
android:title="Home"
android:icon="@drawable/homeb"/>
<item
android:id="@+id/location"
android:showAsAction="always"
android:title="Locations"
android:icon="@drawable/locationb"/>
<item
android:id="@+id/preQualify"
android:showAsAction="always"
android:title="Pre-Qualify"
android:icon="@drawable/prequalityb"/>
<item
android:id="@+id/products"
android:showAsAction="always"
android:title="Products"
android:icon="@drawable/productb"/>
tập tin Java:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_store_locator, menu);
return true;
}
Điều quan trọng là "minWidth" là 80dp theo mặc định. Có nghĩa là ngay cả khi không có đệm có thể có một số không gian. Đó là vấn đề trong trường hợp của tôi. –
Tôi có thể sử dụng kiểu này trong mục menu của mình như thế nào ?? Nếu bạn chia sẻ mã đơn giản, nó sẽ hữu ích Cảm ơn –