カスタマイズされたアクションバーを使用してアプリケーションを作成しています。ただし、画面解像度が異なると、異なるビューが得られました。私はそれを修正しようとしていますが、解決策を実装する方法がありませんでした。
これは、解像度 480 x 800 (HDPI) のエミュレーターのレイアウトです。
一方、これは同じコードを使用した 720 x 1280 (XHDPI) のエミュレーターからの出力です。
ご覧のとおり、設定のアイコンが右上隅に表示されます。これはデフォルトですか?これを削除して、HDPI レイアウトから取得した正しい予想されるレイアウトを表示するには、どのような方法がありますか?
ちなみに、カスタマイズされた ActionBar の XML コードは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="@+id/top_line_1"
android:layout_width="fill_parent"
android:layout_height="1dip" >
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#8284A3" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/top_line_2"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_below="@+id/top_line_1" >
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#6E7095" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/main_action_bar"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:layout_below="@+id/top_line_2"
android:background="@drawable/ab_solid_iformula"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingBottom="7dp"
android:paddingTop="6dp" >
<Button
android:id="@+id/main_top_left_button"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/rounded_nav_button"
android:minWidth="50dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingBottom="6dp"
android:paddingTop="3dp"
android:text="@string/iformula_top_btn_add"
android:textColor="#FFFFFF"
android:textSize="12sp" />
<Button
android:id="@+id/main_top_right_button"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/rounded_nav_button"
android:minWidth="50dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingBottom="6dp"
android:paddingTop="3dp"
android:text="@string/iformula_top_btn_edit"
android:textColor="#FFFFFF"
android:textSize="12sp" />
<TextView
android:id="@+id/main_top_navigation_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/main_top_right_button"
android:layout_alignBottom="@+id/main_top_right_button"
android:layout_centerHorizontal="true"
android:text="@string/app_name"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/below_line"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_below="@+id/main_action_bar" >
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#00103D" />
</RelativeLayout>
</RelativeLayout>
繰り返しますが、設定でアイコンを削除する方法は? HDPI と同じ出力が必要です。