android - TextView side by side in RelativeLayout -
im trying place 2 textviews, same size in width, side side inside relativelayout. in between them have made view of 1 dp in width separate textview. have tried wrap_content both both wont work. textviews called headertext , headertext2 in in id. please me.
<?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:background="#ffffff" android:orientation="vertical" > <imageview android:layout_width="fill_parent" android:layout_height="110dp" android:layout_weight="0.3" android:scaletype="fitxy" android:src="@drawable/hunters" /> <!-- <scrollview --> <!-- android:layout_width="match_parent" --> <!-- android:layout_height="0dip" --> <!-- android:layout_weight="0.7" > --> <!-- <linearlayout --> <!-- android:layout_width="match_parent" --> <!-- android:layout_height="wrap_content" --> <!-- android:orientation="vertical" > --> <!-- <textview --> <!-- android:layout_width="match_parent" --> <!-- android:layout_height="50dp" --> <!-- android:gravity="center" --> <!-- android:textsize="16sp" --> <!-- android:background="@drawable/btntop" --> <!-- android:text="tak dit køb!" --> <!-- android:textstyle="bold" --> <!-- android:textcolor="#d0703d" /> --> <!-- <ir.zinutech.android.denmarkhunters.widgets.zinutextview --> <!-- android:layout_width="match_parent" --> <!-- android:layout_height="wrap_content" --> <!-- android:gravity="left" --> <!-- android:paddingleft="5dp" --> <!-- android:textsize="16sp" --> <!-- android:paddingtop="5dp" --> <!-- android:text="jagt pro er app’en udviklet til dig, der som jæger gerne vil være opdateret på de nyeste jagttider, soltider og schweisshunderegistre m.m., og alt sammen ud fra din position." --> <!-- android:textcolor="#000000" /> --> <!-- <ir.zinutech.android.denmarkhunters.widgets.zinutextview --> <!-- android:layout_width="match_parent" --> <!-- android:layout_height="wrap_content" --> <!-- android:gravity="left" --> <!-- android:paddingleft="5dp" --> <!-- android:textsize="16sp" --> <!-- android:paddingtop="5dp" --> <!-- android:text="teamet bag jagt pro arbejder hele tiden på @ vidreudvikle app´en, så vi kan give vores kunder den bedst mulige brugeroplevelse." --> <!-- android:textcolor="#000000" /> --> <!-- </linearlayout> --> <!-- </scrollview> --> <relativelayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="0.7" > <textview android:id="@+id/headertext" android:layout_width="190dp" android:layout_height="50dp" android:background="@drawable/btntop" android:gravity="center" android:text="danmarks\njægerforbund" android:textcolor="#d0703d" android:paddingtop="5dp" android:paddingbottom="5dp" android:paddingright="5dp" android:paddingleft="5dp" android:textsize="16sp" android:textstyle="bold" /> <view android:background="#d3d3d3" android:layout_height="50dp" android:layout_width="1dp" android:id="@+id/view" android:layout_above="@+id/feedlist" android:layout_torightof="@+id/headertext"/> <listview android:id="@+id/feedlist" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/headertext" android:cliptopadding="false" android:fadingedge="none" android:listselector="@null" > </listview> <textview android:id="@+id/loaidingtext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerinparent="true" android:text="henter nyheder..." android:textsize="16sp" android:textstyle="bold" /> <textview android:id="@+id/headertext2" android:layout_width="wrap_content" android:layout_height="50dp" android:layout_alignparenttop="true" android:layout_toendof="@+id/view" android:background="@drawable/btntop" android:gravity="center" android:layout_alignparentright="true" android:paddingtop="5dp" android:paddingbottom="5dp" android:paddingright="5dp" android:paddingleft="5dp" android:text="jægernes\nmagasin" android:textcolor="#454544" android:textsize="16sp" android:textstyle="bold" /> </relativelayout>
it seems me easiest way go here wrap 2 textviews in linearlayout, like:
it seems me easiest way go here wrap 2 textviews in linearlayout, like: <?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:background="#ffffff" android:orientation="vertical" > <imageview android:layout_width="fill_parent" android:layout_height="110dp" android:layout_weight="0.3" android:scaletype="fitxy" android:src="@drawable/hunters" /> <relativelayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="0.7" > <linearlayout android:id="@+id/linearlayoutidgoeshere" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightsum="2.0" > <textview android:weight="1.0" android:id="@+id/headertext" android:layout_width="190dp" android:layout_height="50dp" android:background="@drawable/btntop" android:gravity="center" android:paddingbottom="5dp" android:paddingleft="5dp" android:paddingright="5dp" android:paddingtop="5dp" android:text="danmarks\njægerforbund" android:textcolor="#d0703d" android:textsize="16sp" android:textstyle="bold" /> <view android:id="@+id/view" android:layout_width="1dp" android:layout_height="50dp" android:layout_above="@+id/feedlist" android:layout_torightof="@+id/headertext" android:background="#d3d3d3" /> <textview android:weight="1.0" android:id="@+id/headertext2" android:layout_width="wrap_content" android:layout_height="50dp" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:layout_toendof="@+id/view" android:background="@drawable/btntop" android:gravity="center" android:paddingbottom="5dp" android:paddingleft="5dp" android:paddingright="5dp" android:paddingtop="5dp" android:text="jægernes\nmagasin" android:textcolor="#454544" android:textsize="16sp" android:textstyle="bold" /> </linearlayout> <listview android:id="@+id/feedlist" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/linearlayoutidgoeshere" android:cliptopadding="false" android:fadingedge="none" android:listselector="@null" > </listview> <textview android:id="@+id/loaidingtext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerinparent="true" android:text="henter nyheder..." android:textsize="16sp" android:textstyle="bold" /> </relativelayout>
though i'd ditch relativelayout in favor of vertically laid out linearlayout don't have deal "layout below" stuff.
hope helps!
Comments
Post a Comment