Question: Assuming I've a scrollview with direction 1 (vertical). While populating the scrollView, the items do appear and are aligned from top to bottom.

I would like to know if there is a way to reverse this ordering i.e. to make the scrollView be populated from the bottom to the top. A good example of usage is a message list. You want the last message to always appear on the bottom of the list. By default, the message would be aligned on top, which is not convenient.

![enter image description here](https://i.stack.imgur.com/DglG6.jpg)

[EDIT]
I just found we can easily set our own transform according to an offset overriding the outputFrom function callback. For example the following will invert the scroll content:

```
scrollview.outputFrom(function(offset)
{
       return  Transform.translate(0, -offset)
});

```

Answer: 
This code works for me:

In the xml add:

* Attribute `ellipsize`: `marquee`
* Attribute `lines`: `1`

In java:

```
<yourTextView>.setHorizontallyScrolling(true);
<yourTextView>.setSelected(true);

```

If there is another item that request the "focus" you lose the marquee effect. The `textView` need the state selected to prevent this.
Actually the problem is with the spannable text, if you set spannable text this wouldn't work. Other than this below code works for me

```
<TextView
    android:id="@+id/tv_second"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="40dp"
    android:layout_margin="5dp"
    android:padding="5dp"
    android:fontFamily="sans-serif-condensed"
    android:textColor="#b3277b"
    android:background="#f7ecff"
    android:layout_below="@id/tv"
    android:text="This is first line\nThis is second line\nThis is third line"
    android:ellipsize="end"
    android:maxLines="2"
    />

```