Reputation: 315
Hi i´m trying to set the margins on a ScrollView with this code but nothing happens.
ScrollView sv = new ScrollView(this);
LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
LayoutParams layoutParams = new ScrollView.LayoutParams(
ScrollView.LayoutParams.FILL_PARENT,
ScrollView.LayoutParams.WRAP_CONTENT);
// layoutParams.bottomMargin = 100;
layoutParams.setMargins(0, 0, 0, 100);
sv.setLayoutParams(layoutParams);
sv.addView(ll);
// Add a TableView to ScrollView...
// Display my view
this.setContentView(sv);
What I'm trying to do is have some buttons bellow the ScrollView so you always see them.
I'm quite new to Android development so any suggestions are appreciated.
/Olle
Upvotes: 2
Views: 5575
Reputation: 2511
I think layoutParams.setMargins(0, 0, 0, 100); does works.but you dont add buttons at the bottom in this way. check out the following links
Two equal sized buttons at bottom of scrollview
Upvotes: 1