Trouble with ListView

后端 未结 3 1016
陌清茗
陌清茗 2021-01-17 00:44

I have an issue with my Main Activity and a ListView and I absolutly don\'t understand how it works...

OK ! This is what I want :

Expectation

3条回答
  •  别那么骄傲
    2021-01-17 01:42

    In your adapter's getView() method, you have to design a child_view layout. The layout which you return will be show in every item of the list. Because you're returning main_activity_layout so every your item would show the mainAcitivy, which contains a button. Solution is create new layout with your own design and replace it with R.layout.main_acitivity_layout. Good luck

提交回复
热议问题