0
TextLayoutとBackgroundcolorを持つViewという2つの要素を持つFrameLayoutを取得しました。 これは予期したとおりに表示されますが、ビューはTextviewをオーバーレイします。 どのように私は別の色のビューにこのレイアウトを膨張させているだけで消え去る。助言がありますか?2つの要素を持つFramelayout
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:layout_width="wrap_content"
android:layout_height="10dp" android:background="#000" android:layout_gravity="bottom" android:id="@+id/viewActive"/>
<TextView
android:id="@+id/textViewName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</FrameLayout>
これはするためのコードでは、あなたの平面図の幅は "wrap_content" に設定されている
LayoutInflater inflater = LayoutInflater.from(context);
ViewGroup view2 = (ViewGroup) inflater.inflate(R.layout.frame_layout, null);
anotherViewGroup.addView(view2);
TextViewはビューをオーバーレイする必要がありますか? TextViewの背景色を透明に設定しようとしましたか? – elijah
**これは予期したとおりに表示されていますか?**はグラフィカルレイアウトを意味しますか? –