3D ページ カールをデザインしようとしています。
私のmainActivityには、カールするページを含むviewPagerがあります。ページごとに個別のレイアウト ファイルがあります。
レイアウト ファイルで、以下のようなテキスト ビューを追加すると、問題なく表示されます。
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/PageTitle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/green"
android:text="VIEW 1" /> -->
しかし、テキストビューを相対レイアウト内にラップすると、白い空白の画面が表示されるだけで、テキストビューは表示されません。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DemoActivity" >
<TextView
style="@style/PageTitle"
android:id="@+id/sampletextview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="VIEW 1" />
</RelativeLayout>
ビュー レイアウト ファイルで相対レイアウトを使用できない理由を教えてください。
ビューを次のように膨らませます。
LayoutInflater inflater = (LayoutInflater) myAppContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view1 = inflater.inflate(mViewIds[0], null);