I want to have a long, single-line TextView to scroll like scrolling stock prices on TV.
I tried with several commands to expand TextView width such as
tview.setMaxWidth(120);
tview.setMaxWidth(512);
tview.setMaxWidth(812);
tview.setMaxWidth(10000);
The first, second, third line work fine but the forth line(long text) does not expand enough.
Does Android have a limitation for a very long text width? Is there any way to have a long TextView which can take long scrollable text?
You can try to use layout params on the TextView
:
LayoutParams lparams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
tview.setLayoutParams(lparams);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.