android - Understanding Layouts dimensioning -
i'm coming android after lonnng break , feel i've lost modjo it.
i'm trying build day-planning relative layout populate events later.
here content view of activity :
<?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" > <scrollview android:layout_width="600dp" android:layout_height="fill_parent" > <relativelayout android:id="@+id/day_main_relative" android:layout_width="match_parent" android:layout_height="wrap_content" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <relativelayout android:id="@+id/day_title_relative" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="3" android:background="@color/blue" > <view //separator android:layout_width="2dp" android:layout_height="0dp" android:layout_alignparentbottom="true" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:background="@color/black" /> </relativelayout> <relativelayout android:id="@+id/day_content_relative" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="10" android:background="@color/light_orange" /> </linearlayout> </relativelayout> </scrollview>
the planning inside scrollview. idea fill ''day_main_relative'' lines want define height of relative layout. i've got keep dynamique, i've done :
for (int = 0; < constants.hour_range; i++) { // cadrillage viewgroup separator = (viewgroup) inflater.inflate( r.layout.week_separator_layout, planningmainlayout, false); viewgroup.marginlayoutparams separatorparams = (viewgroup.marginlayoutparams) separator .getlayoutparams(); separatorparams.setmargins(0, dphourlabel.convertvaluetodpday(i * 60), 0, 0); separator.setlayoutparams(separatorparams); planningmainlayout.addview(separator);
and i'd linearlayout inside of extend @ maximum.
to make short i'd (with black line separator "view" element of contentview):
but obtain this:
Comments
Post a Comment