How to add bulleted list to android application?

后端 未结 17 1390
抹茶落季
抹茶落季 2020-11-29 19:14

I have googled my question but there is not working answer provided. How do add a bulleted list to my textview.

17条回答
  •  孤独总比滥情好
    2020-11-29 19:56

    Here's another solution, not exactly adding a list to one textview, but I guess the goal is the same. It's using TableLayout, that needs only XML and it's really simple for small ordered or unordered lists. Below, sample code I used for this, not a line of code in Java.

    Positive:

    • you can put whatever you like in table rows, doesn't have to be a textview
    • you can use it to create bulleted and numbered list or whatever
    • you can define indent using padding or layout_weight

    Negative:

    • tedious for very long lists (unless you use some crafty text editor with regex)
    • every list item is store as a separate string resource

          
      
              
      
              
          
      
          
              
      
              
          
          
              
              
          
      
      
      
      

    and the style:

    
    

提交回复
热议问题