gpt4 book ai didi

android - 如何在 Horizo​​ntalScrollView 中更改从右向左滚动的方向

转载 作者:行者123 更新时间:2023-11-29 19:32:14 26 4
gpt4 key购买 nike

我制作了一个计算器。我在屏幕右侧放了一些符号。当屏幕尺寸不够时,左侧的符号消失,Horizo​​ntalScrollView 向右侧增加一些空间。

enter image description here

enter image description here

如何从左到右更改滚动表单的方向?

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:id="@+id/top_scr_v"
android:layout_marginTop="@dimen/standard_view_margin">

<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/top_scr_hor_sc_v"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/resultValue"
android:textColor="@color/mainColor"
android:textSize="@dimen/display_text_size"
/>
</HorizontalScrollView>

</ScrollView>

最佳答案

在 API 17 之后,您可以在 android:supportsRtl="true" 之前使用 android:layoutDirection="rtl"

关于android - 如何在 Horizo​​ntalScrollView 中更改从右向左滚动的方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39750387/

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