i have a problem with the TableLayout in Android. I want something like this:
but i dont get it to work :( i tried
android:layout_weight
and
android:layout_gravity="right|center_vertical"
but it still doesnt work. Does anyone has an idea? That's my xml so far:
<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="de.elpudge.lbp.StartActivityModules">
<ImageButton
android:layout_width="25dp"
android:layout_height="25dp"
android:id="@+id/buttonStartModulesMore"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:background="@drawable/start_button_more_selector"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/modules"
android:id="@+id/textView2"
android:layout_alignBottom="@+id/buttonStartModulesMore"
android:layout_centerHorizontal="true" />
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/scrollView"
android:layout_below="@+id/textView2"
android:layout_alignParentStart="true" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:id="@+id/imageView" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:layout_weight="0.7"
android:id="@+id/textView6" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/buttonStartModulesPlay"
android:layout_gravity="right|center_vertical"
android:background="@drawable/start_button_play_selector"/>
</TableRow>
</ScrollView>
</RelativeLayout>
Thank you very much! :)