开发者

How to make a list that can show the changeable content

I have build an application in android. This app needs to display a list of text, but the list of text increase continuously. It means user can see increased list of text. Each text is separated by a horizontal row. It look开发者_开发技巧s like google market when market try to show list of applications. How can i do in this situation ?


You didn't mention where the data came from but let's suppose that you have an ArrayList of your model Text.

Steps:

  • Add a ListView to your layout
  • Extend ArrayAdapter
  • Set this new adapter to your ListView
  • Modify the array adding/removing new stuff
  • Notify the ListView that the data has changed using the adapter's notifyDataSetChanged() method.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜