android,imageview拉伸

android,imageview拉伸,第1张

概述我正在尝试使用可绘制的png来获取我的imageview以填充显示(我不关心比率).但是,fill_parent不起作用,据我所知,没有背景设置为RelativeLayout?问候RelativeLayoutxmlns:android="http://schemas.android.com/apkes/android"android:orientation="vertical"android:layout_wi

我正在尝试使用可绘制的png来获取我的imagevIEw以填充显示(我不关心比率).但是,fill_parent不起作用,据我所知,没有背景设置为relativeLayout?

问候

relativeLayoutxmlns:androID="http://schemas.androID.com/apk/res/androID"androID:orIEntation="vertical"androID:layout_wIDth="fill_parent"androID:layout_height="fill_parent"androID:clickable="true"androID:onClick="toggleAdvice"   ImageVIEw    androID:ID="@+ID/advice_vIEw"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"    androID:src="@drawable/pratbubbla_gron"    androID:layout_alignParenttop="true"    androID:layout_alignParentleft="true"

解决方法:

我以编程方式拉伸/剪切ImageVIEw,可能这段代码可以帮助你:

    ImageVIEw imageVIEw=new ImageVIEw(context);    imageVIEw.setAdjustVIEwBounds(true);    imageVIEw.setimageBitmap(bitmap);    imageVIEw.setMaxHeight(maxHeight);    imageVIEw.setScaleType(ImageVIEw.ScaleType.CENTER_INSIDE);    layout.addVIEw(imageVIEw);
总结

以上是内存溢出为你收集整理的android,imageview拉伸全部内容,希望文章能够帮你解决android,imageview拉伸所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1120159.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存