2012-02-02 5 views
0

Надеюсь, кто-то может помочь мне определить, почему возникают проблемы с нечетным отображением.Android: Нечетное поведение дисплея

Я загружаю xml с помощью кнопок с несколькими кнопками и редактированием текстов, хотя он менял внешний вид на меня из того, что я его проектировал, как в Eclipse, и что работает эмулятор и что работает планшет. Текст редактирования - большая проблема для меня, потому что он по существу скрыт в фоновом режиме.

Я не могу настроить андроид: background = "@ android: color/white", потому что это меняет весь внешний вид. Я просто хотел, что было показано в Eclipse, когда я его разрабатывал.

Odd Edit text and button display

Мой файл XML, как у меня есть это прямо сейчас,

- РЕД полный XML - Примечание: это приводится в скользящем ящик с «включить» методологии. Дайте мне знать, если это потребуется.

<TabHost 
    android:id="@android:id/tabhost" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <LinearLayout 
     android:id="@+id/linearLayout1" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" > 

     <TabWidget 
      android:id="@android:id/tabs" 
      android:layout_width="match_parent" 
      android:layout_height="40dp" /> 

     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" > 

      <LinearLayout 
       android:id="@+id/tab1" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="vertical" > 

       <LinearLayout 
        android:id="@+id/linearLayout2" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:orientation="vertical" > 

        <LinearLayout 
         android:id="@+id/linearLayout3" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:orientation="horizontal" > 

         <CheckBox 
          android:id="@+id/checkBox1" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:text="Active Sync" /> 

         <Spinner 
          android:id="@+id/spinner2" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_weight="1" 
          android:background="@android:color/white" /> 
        </LinearLayout> 

        <LinearLayout 
         android:id="@+id/linearLayout10" 
         android:layout_width="fill_parent" 
         android:layout_height="wrap_content" 
         android:gravity="center" 
         android:orientation="horizontal" > 

         <TextView 
          android:id="@+id/textView1" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_weight="1" 
          android:gravity="center" 
          android:text="Account" /> 

         <TextView 
          android:id="@+id/textView2" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_weight="1" 
          android:gravity="center" 
          android:text="Sync Settings" /> 
        </LinearLayout> 

        <LinearLayout 
         android:id="@+id/linearLayout4" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:orientation="horizontal" > 

         <Spinner 
          android:id="@+id/spinner1" 
          android:layout_width="0dp" 
          android:layout_height="wrap_content" 
          android:layout_weight="1.5" /> 

         <EditText 
          android:id="@+id/editText1" 
          android:layout_width="0dip" 
          android:layout_height="wrap_content" 
          android:layout_weight="1" /> 

         <Button 
          android:id="@+id/button2" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:textSize="12dp" 
          android:text="Edit" /> 
        </LinearLayout> 

        <LinearLayout 
         android:id="@+id/linearLayout4" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:gravity="center" 
         android:orientation="horizontal" 
         android:weightSum="100" > 

         <Button 
          android:id="@+id/button1" 
          android:layout_width="0dp" 
          android:layout_height="wrap_content" 
          android:layout_weight="25" 
          android:text="Load CSV" 
          android:textSize="12dp" /> 

         <Button 
          android:id="@+id/button2" 
          android:layout_width="0dp" 
          android:layout_height="wrap_content" 
          android:layout_weight="25" 
          android:text="Load Excel" 
          android:textSize="12dp" /> 

         <Button 
          android:id="@+id/button3" 
          android:layout_width="0dp" 
          android:layout_height="wrap_content" 
          android:layout_weight="35" 
          android:text="Add Manual" 
          android:textSize="12dp" /> 
        </LinearLayout> 

        <LinearLayout 
         android:id="@+id/linearLayout4" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:orientation="horizontal" > 

         <HorizontalScrollView 
          android:id="@+id/horizontalScrollView1" 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" > 

          <LinearLayout 
           android:id="@+id/linearLayout5" 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:orientation="vertical" > 

           <LinearLayout 
            android:id="@+id/linearLayout6" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:orientation="horizontal" > 
            <EditText 
             android:id="@+id/editText2" 
             android:layout_width="60dp" 
             android:layout_height="wrap_content" 
             android:hint="#" > 
            </EditText> 

            <EditText 
             android:id="@+id/editText3" 
             android:layout_width="160dp" 
             android:layout_height="wrap_content" 
             android:hint="Manufacturer" > 
            </EditText> 


            <EditText 
             android:id="@+id/editText4" 
             android:layout_width="160dp" 
             android:layout_height="wrap_content" 
             android:hint="Model" > 
            </EditText> 
... 

Есть ли «по умолчанию» или «строгий» вид, что я могу выбрать, чтобы сохранить значение по умолчанию, как он отображается в Eclipse?

+0

XML, который вы указали здесь, лишен. Пожалуйста, исправьте это. –

+0

Что вы имеете в виду, разделившись? вы хотите все это? –

+0

Да, чтобы мы могли просто протестировать его. И как ответ Sam_D, вы можете попробовать поместить фоновый рисунок, но не белый, для Android использует 9-патч для таких целей. Но да, это громоздко! :) –

ответ

0

Вы можете попробовать обернуть каждый EditText в ViewGroup, такой как LinearLayout или RelativeLayout, и дать ViewGroup белый фон.

+0

Я дал эту попытку, и это заканчивается тем, что положил на нее белый цвет. Хотя он начинает выглядеть архаичным и с самого начала теряет эстетическую привлекательность. Вы даже не можете сказать, что это может быть редактируемое поле. http://s13.postimage.org/qegqq4is7/test2.png –