简体   繁体   English

Android-适用于TableLayout的ImageView

[英]Android - ImageView fit in TableLayout

How to make sure my Imageview fit in TableLayout ? 如何确保我的Imageview适合TableLayout Mine can't be fit like this one. 我的身体不适合这种人。

在此处输入图片说明

Mine is like this 我的就是这样

在此处输入图片说明

My code 我的密码

<?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>

将此添加到ImageView

android:adjustViewBounds="true"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM