我有一个按以下方式定义的操作栏:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_refresh"
android:icon="@drawable/menu_refresh"
android:showAsAction="always"/>
<item
android:id="@+id/menu_shelves"
android:icon="@drawable/menu_shelves"
android:showAsAction="always"/>
... more items ...
</menu>
这是主要的活动布局:
<com.totalboox.android.views.BorderedLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="6dp" >
<View
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="@color/actionbar_back_color" />
<FrameLayout
android:id="@+id/contentView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.totalboox.android.views.BorderedLinearLayout>
这就是它在带有 os 3.2 的三星 Tab 上的显示方式
这就是它在带有 os 4 的 Motorola Zoom 上的显示方式:
如您所见,它在三星标签上正确显示,但它位于顶部,而不是摩托罗拉 Zoom 的中心。有没有办法确保图标在两个设备上都居中?