Use array adapter with more views in row in listview

后端 未结 4 791
广开言路
广开言路 2020-12-16 01:48

I have stumbled upon a problem I can\'t quite get my head around, so I was hoping perhaps someone here have had the same problem or knew a good way of solving the problem. <

4条回答
  •  鱼传尺愫
    2020-12-16 02:03

    I think that your problem is here:

    Instead of this:

    
    
    
        
    
        
    
        
    
    
    

    Try something like this:

    
    
    
        
    
        
    
        
    
    
    

    If that works, then place your text in the /res/val/string folder like so:

    Put your text here...
    

    and then call like this:

      
    
    
        
    
        
    
        
    
    
    

    You would then set the dynamic values like this:

    TextView tv = (TextView)findViewById(R.id.restaurantname);
    tv.setText(values);
    

提交回复
热议问题