I am new to Android and I am working on a tutorial on programmatically creating a layout instead of doing it via xml, I am just stuck, can someone advise, please.
So, I have a ScrollView, and then added LinearLayout, I want both to be a certain size - 480 x 800 (code below). I was able to set the size in LinearLayout, but I can't get ScrollView to be like that too, but I can't find how to do it.
Is this possible, and so I can just specify the dimensions of the ScrollView and get subsequent views to inherit it.
ScrollView home_scroll = new ScrollView(this); LinearLayout home_linear = new LinearLayout(this); home_linear.setOrientation(LinearLayout.VERTICAL); home_scroll.addView(home_linear, new LinearLayout.LayoutParams(480, 800));
Any help would be greatly appreciated, thanks.
source share