ho visto possiamo impostare 4 valori per android:ellipsize
quali:Android: Ellipsise, significato delle opzioni
nessuno, avviare, a metà, fine e tendone
Qual è il significato e l'effetto di impostare ciascuno di questi?
ho visto possiamo impostare 4 valori per android:ellipsize
quali:Android: Ellipsise, significato delle opzioni
nessuno, avviare, a metà, fine e tendone
Qual è il significato e l'effetto di impostare ciascuno di questi?
vedere l'immagine qui sotto per sapere come funziona android:ellipsize
ho usato XML seguente
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="4"
android:ellipsize="none"
android:singleLine="false"
android:text="Hi make this a very long string that wraps at least 4 lines, seriously make it really really long so it gets cut off at the fourth line not joke. Just do it!"
android:layout_marginBottom="25dip"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="4"
android:ellipsize="start"
android:singleLine="false"
android:text="Hi make this a very long string that wraps at least 4 lines, seriously make it really really long so it gets cut off at the fourth line not joke. Just do it!"
android:layout_marginBottom="25dip"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="4"
android:ellipsize="middle"
android:singleLine="false"
android:text="Hi make this a very long string that wraps at least 4 lines, seriously make it really really long so it gets cut off at the fourth line not joke. Just do it!"
android:layout_marginBottom="25dip"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="4"
android:ellipsize="end"
android:singleLine="false"
android:text="Hi make this a very long string that wraps at least 4 lines, seriously make it really really long so it gets cut off at the fourth line not joke. Just do it!"
android:layout_marginBottom="25dip"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="4"
android:ellipsize="marquee"
android:text="Hi make this a very long string that wraps at least 4 lines, seriously make it really really long so it gets cut off at the fourth line not joke. Just do it!" />
</LinearLayout>
non può essere spiegato meglio .. quindi tendone e fine ha lo stesso effetto. Stavo usando nel mio riquadro di selezione di testo e non veniva sul dispositivo e ho appena provato a testare e alla fine. Qualsiasi commento su questo comportamento. Grazie mille – png
Hai impostato 'android: maxLines =" 4 "', e TextViews hanno 2 righe. Perché? – jul
great post thx! –
http://stackoverflow.com/questions/2160619/android-ellipsize-multiline-textview –