Android - Programmatically specify height and width of new ScrollView

后端 未结 3 1715
醉梦人生
醉梦人生 2021-02-10 02:27

I\'m new to Android and I\'m working through a tutorial on programmatically creating a layout instead of doing it through the xml, I\'m sorta stuck can someone advise please.

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-10 03:20

    Did you try doing something like

    home_scroll.setLayoutParams(..,..);
    

    you can find these here

    setLayoutParams(ViewGroup.LayoutParams params) 
    Set the layout parameters associated with this view.
    

提交回复
热议问题