Reputation: 95
I have a TextView in my application. I want to align 2 separate text one ontop of the other. But have no idea how. Any suggestions ?
Text code that is to be displayed:
String[] product_showcase_list = new String[] {
"Product Name 产品名称 : Office Chair 1 " +
"Product Serial 产品号码 :0C012345",
...
}
code that is used to call out String text:
label_col_1_datatab3.setText(product_showcase_list[cnt]);
Currently, what is being displayed on the screen:
Product Name 产品名称 : Office Chair 1 Product Serial 产品号码 :0C012345
How it is needed to be displayed:
Product Name 产品名称 : Office Chair 1
Product Serial 产品号码 :0C012345
Upvotes: 0
Views: 98
Reputation: 1744
Within your loop, change as below.
String temp = product_showcase_list[cnt] + "\n"
label_col_1_datatab3.setText(temp);
Hope it helps!
Upvotes: 1
Reputation: 1701
"Product Name 产品名称 : Office Chair 1 \n" + "Product Serial 产品号码 :0C012345"
Upvotes: 1