とTextView
がネストされたRelativeLayout
があります。 RelativeLayout
の背景は9patchイメージで定義されていますが、子ビューは9patchイメージのコンテンツ領域に正しく従っていません。9patchイメージでコンテンツ領域が定義されていないと表示されます。ここで 9パッチのコンテンツ領域にプログレスバーとテキストビューを描画します
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:background="@+drawable/loading_screen"
android:padding="0dip" >
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_above="@+id/progressBar1"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="@string/loading"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/black" />
</RelativeLayout>
そして、ここに私の9patchファイルです:
投稿9パッチ – FoamyGuy
@Timが投稿しました。 – Drew