HorizontalScrollView Always on the right after adding Android APP text

0

A small question I would like to know how it is possible that a HorizontalScrollView that I fill with text is always kept to the right thing that you see the last text entered, I'm doing a calculator type windows 10. The application I'm developing in android studio and so far I have this

<HorizontalScrollView
    android:id="@+id/ScrollCalculadoraHistorial"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:orientation="vertical">

        <TextView
            android:id="@+id/txtCalculadoraHistorial"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dp"
            android:text=""
            android:textSize="30sp" />
    </LinearLayout>
</HorizontalScrollView>

and in the activity I use this but I do not function 100% ScrollCalculadoraHistorial.fullScroll(View.FOCUS_RIGHT); since it moves to the right but not at the end of this

    
asked by Ignacio Fuentes 13.09.2018 в 01:49
source

1 answer

0

You could populate with this: D

I have modified the XML, I hope it works for you: D.

<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">


    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end"
        android:orientation="vertical">

        <TextView
            android:id="@+id/txtCalculadoraHistorial"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dp"
            android:gravity="center_vertical|end"
            android:text=""
            android:textSize="30sp" />
    </LinearLayout>
</HorizontalScrollView>
    
answered by 13.09.2018 в 06:22