fill-parent

Child of RelativeLayout is not filling the height of the RelativeLayout

﹥>﹥吖頭↗ 提交于 2019-11-30 12:37:57
I have a ListView which gets populated with RelativeLayouts. The content of these RelativeLayouts can change and thus change their height respectively. On each RelativeLayout, I have a little vertical bar on the left side of the layout that matches the height of the layout. It's a similar look to this -> Link Though for some reason, the View object that I'm using isn't expanding to the height of the layout. What am I doing wrong? <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/post" android:layout_width="fill

Android 3 - Adding a Fragment to a LinearLayout: fill_parent does not work

拟墨画扇 提交于 2019-11-29 06:02:24
I am trying to add a fragment programmatically to a LinearLayout, but the fragment does not stretch its content across the whole layouts height. It acts like wrap_content instead of fill_parent. On the other side the fill_parent works on the fragment's width. How can I change this behaviour? DashboardActivity: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <fragment android:id="@+id/fragment_dashboard" android:layout_width=