[英]How to rotate a view in android and also adjust its height in respect to parent view
你可以檢查這個庫,它讓你很容易: https://github.com/rongi/rotate-layout\因為它有你正在尋找的功能,邊界框與里面的視圖一起旋轉。
implementation 'rongi.rotate-layout:rotate-layout:3.0.0'
<com.github.rongi.rotate_layout.layout.RotateLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:angle="90"> <!-- Specify rotate angle here -->
<YourLayoutHere
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</YourLayoutHere>
</com.github.rongi.rotate_layout.layout.RotateLayout>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.