2016-09-28 129 views
0

我構建了一個計算器。我在屏幕的右側放置了一些符號。當屏幕尺寸不夠時,左側的符號消失,Horizo​​ntalScrollView向右側添加一些空間。如何在Horizo​​ntalScrollView中從右向左更改滾動方向

enter image description here

enter image description here

如何更改滾動形式的directon從左向右?

<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> 

回答

1

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

相關問題