它 在 xml 布局里 是可以 用 android:layout_height="180dp"
来制定大小的现在,我想在 在 代码里改变大小是什么方法呢? 
我查了下API,还是没查到

解决方案 »

  1.   

    public void setLayoutParams (ViewGroup.LayoutParams params)Since: API Level 1
    Set the layout parameters associated with this view. These supply parameters to the parent of this view specifying how it should be arranged. There are many subclasses of ViewGroup.LayoutParams, and these correspond to the different subclasses of ViewGroup that are responsible for arranging their children.
    Parametersparams The layout parameters for this view, cannot be null
    http://developer.android.com/reference/android/view/View.html#setLayoutParams(android.view.ViewGroup.LayoutParams)
    RelativeLayout.LayoutParams  rlp = new RelativeLayout.LayoutParams(300,400);
     rlayout.setLayoutParams(rlp);
     
      

  2.   


    1.如果我想重新制定 这个 RelativeLayout 位于另外一个 RelativeLayout之下,有什么方法吗?
    原因是我在重新制定大小之后,显示的布局 覆盖了上面的RelativeLayout了
      

  3.   


    .如果我想重新制定 这个 RelativeLayout 位于另外一个 RelativeLayout之下,有什么方法吗?
    原因是我在重新制定大小之后,显示的布局 覆盖了上面的RelativeLayout了