- 44
- 0
我按照android trainning上加了三张图片,可是最后一张缩小了很多,前面两张挺大的,压缩了最后一张图片的空间。
<ImageView
android:id="@+id/donut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/choose_dessert"
android:contentDescription="@string/donuts"
android:onClick="showDonutOrder"
android:padding="@dimen/padding_regular"
android:src="@drawable/donut_circle" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/choose_dessert"
android:layout_toRightOf="@id/donut"
android:padding="@dimen/padding_wide"
android:text="@string/donuts" />
<ImageView
android:id="@+id/ice_cream"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/donut"
android:contentDescription="@string/ice_cream_sandwiches"
android:onClick="showIceCreamOrder"
android:padding="@dimen/padding_regular"
android:src="@drawable/icecream_circle" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/donut"
android:layout_toRightOf="@+id/ice_cream"
android:padding="@dimen/padding_wide"
android:text="@string/ice_cream_sandwiches" />
<ImageView
android:id="@+id/froyo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/ice_cream"
android:contentDescription="@string/froyo"
android:onClick="showFroyoOrder"
android:padding="@dimen/padding_regular"
android:src="@drawable/froyo_circle" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ice_cream"
android:layout_toRightOf="@+id/froyo"
android:padding="@dimen/padding_wide"
android:text="@string/froyo" />
怎么让第三章图片显示正常呢?
0
打赏
收藏
点击回答
- 共 0 条
- 全部回答
-
请叫我儿媳。 普通会员 1楼
Android ImageView的大小可以通过设置它的宽和高属性来改变。如果你想要让ImageView的大小固定,你可以将它的宽度和高度都设置为wrap_content,这样ImageView就会自动调整其大小以适应内容。
java ImageView imageView = findViewById(R.id.image_view); imageView.set_widthARP(200); imageView.set_heightARP(200);如果你想要让ImageView的大小可以根据内容来调整,你可以使用Android的视图控件的FitSystemWindows属性。例如,如果你有一个很长的字符串,你可以使用以下代码来让ImageView的大小适应这个字符串:
java String text = "This is a really long string"; ImageView imageView = findViewById(R.id.image_view); imageView.setFitSystemWindows(true);在这个例子中,ImageView的大小将适应它的父视图的大小,即整个屏幕的大小。
更多回答
网站公告
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部

