大佬教程收集整理的这篇文章主要介绍了Android将图像放在RelativeLayout的顶部和中心,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<ImageView android:id="@+id/collection_image_BACkground" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" />
,但此代码无效.我的图像居中,但未在我的相对布局顶部对齐.我尝试使用android:scaleType =“fitStart”,但它实际上是将图像左侧和顶部对齐的父级.
所以任何想法如何我可以正确对齐图像?
附:我忘了提到我正在将图像设置为我的ImageView,如下所示:
BitmapFactory.options o2 = new BitmapFactory.options(); o2.inTempStorage = new byte[8*1024]; ops = BitmapFactory.decodeStream(cis,null,o2); ImageView view = (ImageView) findViewById(R.id.collection_image_BACkground); view.setImageBitmap(ops);
以上是大佬教程为你收集整理的Android将图像放在RelativeLayout的顶部和中心全部内容,希望文章能够帮你解决Android将图像放在RelativeLayout的顶部和中心所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。