如何解决ImageView的大小
| 谁能帮我? 为什么ImageViews的大小不同? 您可以在下面找到代码。<?xml version=\"1.0\" encoding=\"utf-8\"?>
<LinearLayout
xmlns:android=\"http://schemas.android.com/apk/res/android\"
android:layout_width=\"fill_parent\"
android:layout_height=\"fill_parent\"
android:id=\"@+id/layout\"
android:orientation=\"vertical\">
<FrameLayout
android:id=\"@+id/preview\"
android:layout_weight=\"1\"
android:layout_width=\"fill_parent\"
android:layout_height=\"fill_parent\">
<SurfaceView
android:id=\"@+id/surface_camera\"
android:layout_height=\"fill_parent\"
android:layout_width=\"fill_parent\" />
</FrameLayout>
<TableLayout
android:orientation=\"vertical\"
android:layout_width=\"fill_parent\"
android:layout_height=\"wrap_content\">
<TableRow
android:layout_width=\"fill_parent\"
android:minHeight=\"10dip\">
<ImageView
android:layout_width=\"fill_parent\"
android:layout_weight=\"1\"
android:id=\"@+id/buttonClick\"
android:text=\"Click\"
android:maxHeight=\"10dip\"
android:layout_gravity=\"center\"
android:src=\"@drawable/folder\" />
<ImageView
android:layout_width=\"fill_parent\"
android:layout_weight=\"1\"
android:id=\"@+id/buttonClick\"
android:text=\"Back\"
android:maxHeight=\"10dip\"
android:src=\"@drawable/back\" />
<ImageView
android:layout_weight=\"1\"
android:layout_width=\"fill_parent\"
android:id=\"@+id/buttonClick\"
android:text=\"Folder\"
android:maxHeight=\"10dip\"
android:src=\"@drawable/camera_alt\" />
</TableRow>
</TableLayout>
</LinearLayout>
解决方法
我尝试用
android:src=\"@android:drawable/ic_menu_delete\"
布局,并且所有视图在模拟器中的高度和宽度都相同,
但是,如果我使用2 ic_menu_delete和第三个(例如@android:drawable / arrow_down_float),则它们具有不同的大小,
因此这意味着您的可绘制对象具有不同的大小(它们没有达到maxHeight = \“ 10dip \”)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。