2012-01-26 8 views
0

さまざまな色を表示します。この画像を参照してくださいタブレットエミュレータでアプリを起動すると、同じレイアウトでタブレットに異なる色が表示される

enter image description here

(それはそれのほんの一部を示すので、私は画像の右側をカットしています)そして、これは、スタンダールのスマートフォンエミュレータからである:だから

enter image description here

あなたは奇妙な違いがあることがわかります。しかし、コードは同じです。ここに私のレイアウトですxml:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res/com.markupartist.android.actionbar.example" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

    <com.markupartist.android.widget.ActionBar 
     android:id="@+id/actionbar" 
     style="@style/ActionBar" 
     app:title="@string/some_title" /> 

    <RelativeLayout 
     xmlns:a="http://schemas.android.com/apk/res/android" 
     a:layout_width="fill_parent" 
     a:layout_height="fill_parent" 
     a:background="#ffffff" > 

     <LinearLayout 
      a:layout_width="fill_parent" 
      a:layout_height="wrap_content" 
      a:orientation="horizontal" 
      a:paddingBottom="5dip" 
      a:paddingLeft="5dip" 
      a:paddingRight="5dip" 
      a:paddingTop="5dip" > 

      <MultiAutoCompleteTextView 
       a:id="@+id/recipientBody" 
       a:layout_width="0dip" 
       a:layout_height="wrap_content" 
       a:layout_weight="1.0" 
       a:hint="@string/sms_to_whom" 
       a:maxLines="10" 
       a:nextFocusRight="@+id/smsRecipientButton" /> 

      <LinearLayout 
       a:layout_width="wrap_content" 
       a:layout_height="fill_parent" 
       a:orientation="vertical" > 

       <Button 
        a:id="@+id/smsRecipientButton" 
        a:layout_width="wrap_content" 
        a:layout_height="0dip" 
        a:layout_marginLeft="5dip" 
        a:layout_weight="1.0" 
        a:enabled="true" 
        a:nextFocusLeft="@+id/recipientBody" 
        a:onClick="onPickContact" 
        a:text="@string/sms_contacts" /> 
      </LinearLayout> 
     </LinearLayout> 

     <LinearLayout 
      a:layout_width="wrap_content" 
      a:layout_height="fill_parent" 
      a:layout_marginRight="10dip" 
      a:layout_marginBottom="10dip" 
      a:gravity="bottom" 
      a:orientation="vertical" 
      a:layout_above="@+id/bottomLayer" a:layout_alignParentRight="true"> 

      <TextView 
       android:id="@+id/chars" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:text="" /> 
     </LinearLayout> 

     <LinearLayout 
      a:id="@+id/bottomLayer" 
      a:layout_width="fill_parent" 
      a:layout_height="wrap_content" 
      a:layout_alignParentBottom="true" 
      a:background="#9c9e9c" 
      a:orientation="horizontal" 
      a:paddingBottom="5dip" 
      a:paddingLeft="5dip" 
      a:paddingRight="5dip" 
      a:paddingTop="5dip" > 

      <EditText 
       a:id="@+id/smsBody" 
       a:layout_width="0dip" 
       a:layout_height="wrap_content" 
       a:layout_weight="1.0" 
       a:autoText="true" 
       a:capitalize="sentences" 
       a:hint="@string/sms_enter_message" 
       a:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine" 
       a:nextFocusRight="@+id/send_button" 
       a:minLines="5" 
       a:gravity="left|top"/> 

      <LinearLayout 
       a:layout_width="wrap_content" 
       a:layout_height="fill_parent" 
       a:orientation="vertical" > 

       <Button 
        a:id="@+id/smsSendButton" 
        a:layout_width="wrap_content" 
        a:layout_height="0dip" 
        a:layout_marginLeft="5dip" 
        a:layout_weight="1.0" 
        a:enabled="false" 
        a:nextFocusLeft="@+id/smsBody" 
        a:text="@string/sms_send_abbr" /> 
      </LinearLayout> 
     </LinearLayout> 
    </RelativeLayout> 
</LinearLayout> 

何が間違っているか、それを修正する方法はありますか?

+1

間違っているわけではありません。 Androidはデバイス/ Androidバージョンのデフォルトスタイルを使用します。タブレットのデフォルトのスタイルはスマートフォンのスタイルとは異なります。アプリでデフォルトのスタイルに固執することは良い考えであるため、この動作は正しいことが分かります。 –

+0

ありがとうございます、あなたが望むなら、これを答えにすることができます。 –

答えて

2

間違っているわけではありません。 Androidはデバイス/ Androidバージョンのデフォルトスタイルを使用します。タブレットのデフォルトのスタイルはスマートフォンのスタイルとは異なります。アプリでデフォルトのスタイルに固執することは良い考えであるため、この動作は正しいことが分かります。

関連する問題