Horizontal ListView in Android?

后端 未结 19 984
深忆病人
深忆病人 2020-11-22 03:54

Is it possible to make the ListView horizontally? I have done this using a gallery view, but the selected item comes to the center of the screen automatically.

19条回答
  •  旧时难觅i
    2020-11-22 04:36

    Its actually very simple: simply Rotate the list view to lay on its side

    mlistView.setRotation(-90);

    Then upon inflating the children, that should be inside the getView method. you rotate the children to stand up straight:

     mylistViewchild.setRotation(90);
    

    Edit: if your ListView doesnt fit properly after rotation, place the ListView inside this RotateLayout like this:

      
    
        
        
    
    

提交回复
热议问题