style.xml
设置好了。如下。
<style name="ask_for_help_main_listitem">
<item name="android:textColor">@color/black</item>
<item name="android:textSize">20px</item>
<item name="android:lines">2</item>
<item name="android:paddingLeft">2px</item>
<item name="android:gravity">left|center_vertical</item>
<TextView
android:id="@+id/ti_mu_title_tx2"
style="@style/ask_for_help_main_listitem"
android:layout_width="287px"
android:layout_height="59px"
android:background="@null"
android:text="题目题目题目题目题目题目题目题目题目" />
但是textView内容会超过范围大小只显示一行。
解决方法:
改成
<LinearLayout
android:layout_width="287px"
android:layout_height="59px"
android:gravity="center_vertical" >
<TextView
android:id="@+id/ti_mu_title_tx0"
style="@style/ask_for_help_main_listitem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="题目题目题目题目题-------------题目题目" />
</LinearLayout>