Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是新的 android 开发人员,从可绘制文件夹中设置图像。
看亲爱的图片:
输出:
当图像为矩形时,设置图像视图矩形,图像为正方形,然后设置图像视图正方形。如何实现这种功能?
请帮我
根据评论回答
尝试这个
将您的图像放在res/drawable文件夹中,然后
res/drawable
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/rectangle" /> <-- your image in drawable