我必須在Android中顯示Textview
從xml
Feed中獲取。textview在android中打包
讓我們看看這是我Textview
:
馬利卡·謝拉沃特的即將上映的電影骯髒的政治
在這裏,我已經創建的佈局動態地爲這些Textview
:
LinearLayout.LayoutParams textLayoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 50);
textLayoutParams.gravity = Gravity.CENTER;
TextView tv = new TextView(this);
tv.setSingleLine(false);
tv.setEllipsize(null);
tv.setHorizontallyScrolling(false);
tv.setTextColor(Color.parseColor("#a7a9ac"));
tv.setText(Appscontent.Sub_arraylisttwo.get(j));
tv.setLayoutParams(textLayoutParams);
tv.setBackgroundColor(Color.parseColor("#414042"));
我剛纔提到的寬度50在這裏。
,使文本顯示以及小內容Textview
。有些時候,我有更多的內容Textview
這意味着我怎麼能顯示Textview
象下面這樣:
我是說文字是要顯示最高2只有在文本被擴展後的行才意味着簡單地添加...內容像上面的example.how我可以做嗎?請幫幫我 。
thanks..its爲我工作.... – user2182071 2013-03-19 04:03:03