相对布局中滚动视图之间的空间

问题描述:

在相对布局中在两个ScrollView之间添加空间的最佳方式是什么?您能举个例子吗?我一直在尝试使用填充小运气。相对布局中滚动视图之间的空间

在第二个列表视图中使用android:layout_below="@+id/ScrollView01"将其位置设置为第一个滚动视图的下方。还设置android:layout_marginTop="50dip"到第二滚动视图,得到第一滚动视图和第二滚动视图

之间一些余量尝试下面的代码

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#ffffff"> 
    <ScrollView 

     android:id="@+id/ScrollView01" 
     android:layout_height="wrap_content" 
     android:layout_width="fill_parent" 
     android:background="#000000"> 
     <RadioGroup 
      android:id="@+id/RadioGroup01" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"> 
      <RadioButton 
       android:id="@+id/RadioButton01" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Radio Button....." /> 

     </RadioGroup> 
    </ScrollView> 
    <ScrollView 

     android:id="@+id/ScrollView02" 
     android:layout_height="wrap_content" 
     android:layout_width="fill_parent" 
     android:background="#000000" 
     android:layout_below="@+id/ScrollView01" 
     android:layout_marginTop="50dip"> 

     <RadioGroup 
      android:id="@+id/RadioGroup01" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"> 
      <RadioButton 
       android:id="@+id/RadioButton02" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Radio Button....." /> 
     </RadioGroup> 
    </ScrollView> 

</RelativeLayout> 

由于 迪帕克

也许尝试使用余量,而不是填充?我不是100%确定这是否能解决您的问题,但值得一试。