2015-04-18 6 views
0

Как убедиться, что мой Imageview подходит к TableLayout? Моя не может быть такой, как эта.Android - ImageView вписывается в TableLayout

enter image description here

Шахта как этот

enter image description here

Мой код

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:scrollbars="none" > 

    <TableLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" > 

     <TableRow 
      android:id="@+id/tableRow1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" > 

      <LinearLayout android:orientation="horizontal" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1"> 

       <ImageView 
        android:id="@+id/imageView1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:src="@drawable/kelas_mengaji" /> 

      </LinearLayout> 

     </TableRow> 
</TableLayout> 

</ScrollView> 

Пожалуйста, советы. Спасибо.

+0

согласно кода я получаю нужный ответ – silverFoxA

ответ

0

Добавьте к этому ImageView

android:adjustViewBounds="true" 
+0

хороший один братан, это работает !! –

+0

Добро пожаловать :) –

Смежные вопросы