2011-12-04 15 views
0

タイトルバーをカスタマイズしました。アンドロイドのカスタムタイトルが親の横に塗りつぶされない

<RelativeLayout android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 
     <TextView android:id="@+id/textview" android:textStyle="bold" 
      android:layout_width="fill_parent" android:layout_height="wrap_content" 
      android:gravity="center" android:text="fggffgjjkki" 
      android:textSize="30sp" 
         android:textColor="#FFFFFF" android:background="@drawable/top_bar" /> 
</RelativeLayout> 

コード:fill_parentは

コードが

<resources> 
    <style name="LargeTitleTheme"> 
     <item name="android:windowTitleSize">40dip</item> 
    </style> 
</resources> 

XML2を下回っている両側にいくつかの空白で親 を満たしていない、そのよう私は幅を言及しているものの 問題は次のとおりです。

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); 
     setContentView(R.layout.homegrid); 
     getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.customtitle); 

答えて

1

私は同じ問題に直面していましたが、タイトルの左右には灰色の色のパディングがありました。

次に、ここで説明した手順、Android: Custom Title Barに従い、カスタムタイトルの背景色と同じカスタムスタイルの背景色を指定します。その後、それは動作します!

  • Herojit
+0

をdoesntの。答えてくれてありがとう – png

0

Android:lを追加してみてくださいayout_marginLeft = "0dp" android:layout_marginRight = "0dp"をRelativeLayoutに設定します。

+0

残念ながら、それは不思議のように働いた作業 – png

関連する問題