android - How can i make the three views always be in one line and also always have the same amount of space between them? -
my goal have 3 views in 1 line no matter how big display of device is. want 3 views have same amount of space between them, symmetrical. these 2 things possible , if so, how? thank in advance!
<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="com.juliandrach.eatfit.mainactivity"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparenttop="true"> <imageview android:layout_width="48dp" android:layout_height="48dp" android:background="@drawable/profilbild" android:layout_margin="10dp" /> <textview android:layout_width="0dp" android:layout_height="wrap_content" android:text="ernährungspläne" android:textallcaps="true" android:textsize="21sp" android:layout_margintop="15dp" android:textcolor="@android:color/black" android:layout_weight="2" /> <textview android:layout_width="0dp" android:layout_height="wrap_content" android:text="shop" android:textallcaps="true" android:textsize="25sp" android:textcolor="@android:color/black" android:layout_weight="1" android:layout_margintop="15dp"/> </linearlayout> (...)
final check out
<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="com.juliandrach.eatfit.mainactivity"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:weightsum="3" android:orientation="horizontal" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true"> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@mipmap/ic_launcher" android:layout_weight="0" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="ernährungspläne" android:textallcaps="true" android:textsize="21sp" android:layout_margintop="15dp" android:layout_marginleft="15dp" android:textcolor="@android:color/black" android:layout_weight="1" android:id="@+id/textview" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="shop" android:textallcaps="true" android:textsize="21sp" android:layout_margintop="15dp" android:layout_marginleft="15dp" android:textcolor="@android:color/black" android:layout_weight="1" android:id="@+id/textview1" /> </linearlayout> </relativelayout>
shifted left
Comments
Post a Comment