【发布时间】:2015-03-24 17:23:00
【问题描述】:
我正在尝试在 android 中扩展 textview,我有一些带有批量内容的 textview,我的要求是仅显示批量内容中的两行并完成 (...)。如果我点击它,我的全部内容将不得不显示。如何 实现这一目标。你能帮帮我吗?
public class MainActivity extends ActionBarActivity {
TextView t1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
t1 = (TextView) findViewById(R.id.text);
String str = "If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying. This allows animations for those drawables to be scheduled." +
"I made the expandable list view acc to your tutorial but what i have to do if I want to populate Expandable List View with values from database?Means what changes I have to do in ";
t1.setText(str);
t1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
t1.setMaxLines(Integer.MAX_VALUE);
}
});
}
}
【问题讨论】:
标签: android textview expandable