2012-07-10 26 views
6

TextViewのようないくつかのビューには、独自のパディングまたは余白があります... textViewにtextSize 16dpを設定すると、このコントロールを表示するにはhdpiデバイス画面で24ピクセル以上が必要です。 。 @ DIMEN/activity_vertical_marginまたは@ DIMEN/activity_horizo​​ntal_margin:たぶん私は何かが欠けてる、レイアウトを使用している間、使用可能なデフォルトのマージンやパディングがこれですアンドロイドでアンドロイドのデフォルトのパディングまたは余白を表示する

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

     <View 
      android:layout_width="match_parent" 
      android:layout_height="1px" 
      android:background="@color/closed_red" /> 

     <TextView 
      android:id="@+id/uc_button_title_text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_margin="0dp" 
      android:includeFontPadding="false" 
      android:background="@null" 
      android:padding="0dp" 
      android:text="@string/demo_text" 
      android:textColor="#325083" 
      android:textSize="16dp" 
      android:textStyle="bold" /> 

     <View 
      android:layout_width="match_parent" 
      android:layout_height="1px" 
      android:background="@color/closed_red" /> 
    </LinearLayout> 
+0

http://developer.android.com/guide/practices/screens_support.htmlにある1.5倍の乗数に基づいて正確に24になると思われますか? –

+0

ええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええええと> – Orest

+0

あなたは正しいです、ただ関係を理解し​​ようとしていた。実際のテキストが24pxまたはテキスト+その周りのスペースよりも大きいと言っていますか? –

答えて

4
<LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_marginTop="@dimen/activity_vertical_margin" 
     android:layout_marginBottom="@dimen/activity_vertical_margin" 
     android:layout_marginLeft="@dimen/activity_horizontal_margin" 
     android:layout_marginRight="@dimen/activity_horizontal_margin" 
     android:orientation="vertical"> 
    </LinearLayout> 

を助けてください。私は上記の例のコードを入れました。

関連する問題