android - 旋转布局的背景图像
问题描述
我已经FrameLayout.
设置了它的背景。现在我想在旋转更改时以编程方式旋转它onConfigurationChanged
。
我这样做了,但它改变了所有布局旋转
frameLayout.setRotation(180)
我不想放置不同的旋转图像。如何只改变背景图像的旋转,而不是整个布局?
解决方案
此代码仅用于旋转图像:
android:rotation="90"
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rotation="90"
android:contentDescription="@string/image_divider"
android:paddingBottom="8dp"
android:paddingTop="4dp"
android:scaleType="fitXY"
android:src="@android:drawable/image" />
推荐阅读
- laravel - Laravel 刷新特定播种器
- java - 使用 Spring Integration 接收邮件?
- sql-server - 如何替换 yyyymmdd 以选择表名称的最新月份结束日期
- python - 如何使用 python 获取多个 JSON 字符串以呈现为数据框?
- python - 从包含列表的 Python 字典中替换 SQL“in”语句中的方括号和引号
- node.js - 如何使用 Javascript 获取 Firebase 数据库中子项的值?
- css - Object-fit 不覆盖整个包含区域
- javascript - 如何在javascript中的文本旁边添加图像?
- sql-server - 在 SQL 中取消透视表并按条件连接
- python - 如何用曲线上的点填充列表?