2011-06-10 115 views
2

您好我正尝试使用此代码设置ScrollView上的边距,但没有任何反应。以编程方式设置滚动视图上的边距

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); 

我想要做的是有一些按钮在ScrollView的下方,所以你总是看到它们。

我对Android开发颇为陌生,所以有任何建议,我们将不胜感激。

/奥莱

回答

相关问题