gpt4 book ai didi

Android镜像矢量可绘制

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:36:47 25 4
gpt4 key购买 nike

我使用 Material 图标 (ic_play_arrow_black_24dp),用 vector studio 导入它。

现在我希望箭头也指向另一个方向,而不创建第二个向量。这在 xml 中是否可行?如何实现?

我在两个 float 操作按钮中使用 drawable,一个用于下一个,另一个用于上一个。

编辑这是 fab 按钮的 XML。我已经尝试过旋转和缩放,但没有用

<android.support.design.widget.FloatingActionButton
android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|bottom"
android:layout_marginBottom="0dp"
android:layout_marginEnd="80dp"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:src="@drawable/next_prev_24dp"
app:layout_anchor="@id/next"
app:layout_anchorGravity="left" />

最佳答案

对于那些使用 ImageViewTextViewEditText 的人来说,缩放效果很好。使用

android:scaleX="-1" //To flip horizontally or
android:scaleY="-1" //To flip vertically

或尝试

android:rotationX="180" // for horizontal
android:rotationY="180" // for vertical

或者简单地 rotation="180" 垂直

android:rotation="180" // for vertical

编辑:附加
如果您想在更改语言 RTL/LTR(“从右到左”/“从左到右”)时翻转/镜像图标/drawable,在 android vector drawable 中有一个很好的方法,只需选中 ckeckbox Enable RTL 布局的自动镜像

=> Right Click on drawable folder => New => Vector Asset => Select drawable => check the Checkbox

.

关于Android镜像矢量可绘制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36329687/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com