在TableLayout中的ImageView上的ImageButton

时间:2015-07-28 11:57:07

标签: android imageview tablelayout

我正在为Android编写应用程序,我对TableLayout有困难。所以我想将ImageView放在一行ImageButton上,但当我将它们放在同一行时,即使我设置了alligment,它们也是相邻的。 我复制我的xml代码:

  <TableLayout
    android:id="@+id/TableLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="30dp"
    android:layout_marginRight="30dp"
    android:stretchColumns="0"
    tools:context="hu.szada.examplefortable.MainActivity" >

    <TableRow
        android:id="@+id/TableRow1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginTop="30dp"
        android:layout_alignParentRight="true" >

        <ImageButton
            android:id="@+id/ajandekboltbutton"
            android:layout_width="wrap_content"
            android:layout_height="130dp"
            android:background="@drawable/ajandekbolt" />
        <ImageView 
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_marginLeft="0dp"
            android:layout_alignParentRight="true"
            android:src="@drawable/pipalista"/>

    </TableRow>

  </TableLayout>

  </ScrollView>

如果有人知道该怎么做,请回复!

0 个答案:

没有答案