Androidアプリケーションを開発しているうちに、わずらわしい問題が発生しました。私が作成しているUI要素は、カスタム検索フィールドを持つヘッダーバーです。 AndroidのUIエディタではすばらしく見えますが、もう1つはエミュレータまたはデバッガを使って虫眼鏡の画像を圧縮し、編集テキストをクリップします。私は現在、親LinearLayoutにあるカスタム検索フィールドに検索エリアの背景イメージを変更することを含む多くのことを試みました。これにより、検索フィールドのサイズが制御不能になります。Android UIエディタ/ディスプレイバグ
ご提案は大歓迎です。
私の質問は次のとおりです。
1)検索領域の外観を維持しながら、この問題をどのように修正しますか?
2)この問題が発生するのはなぜですか?これは、UIエディタのスクリーンショットです
サムスンギャラクシーネクサス4.0.2
モトローラズーム4.0.3
ネクサスS 2.3.7
:
これは、テストしたすべてのデバイスでどのように見えるのスクリーンショットです:
これらのUI要素を生成するために使用されるXML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/title_bar_matte"
android:gravity="center_vertical"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:layout_weight="1.0"
android:background="@drawable/search_field"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginLeft="15dp"
android:src="@drawable/magnifying_glass" />
<EditText
android:id="@+id/campus_map_acitivity_search"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_marginLeft="10dp"
android:layout_weight="1.0"
android:background="#0FFF"
android:hint="Search"
android:imeOptions="actionSearch"
android:singleLine="true" />
</LinearLayout>
<Button
android:id="@+id/campus_map_activity_goto_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/button_list" />
<Button
android:id="@+id/campus_map_activity_my_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/button_location" />
</LinearLayout>