2014-10-05 52 views

回答

0
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/FrameLayout1" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 
     <ImageView 
        android:id="@+id/ImageView1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:background="@drawable/ic_launcher" 
        /> 
     <ScrollView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" > 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="vertical" 
       android:padding_top="200dp" 
      > 

       <TextView 
        android:id="@+id/textView1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginTop="100dp" 
        android:text="@string/hello_world" /> 
      </LinearLayout> 
     </ScrollView> 

    </FrameLayout> 

将线性布局的Padding_top设置为imageView的高度(在java中执行此操作或设置一些像我所做的那样的随机数)。希望这会起作用。

+0

谢谢,它的作品:) – David 2014-10-05 18:51:57

+0

快乐,我可以帮助你。快乐的编码。 – Harsha 2014-10-05 18:52:50

+0

代表@ RTN073:上述解决方案对我而言并不像预期的那样。请你提供相应的java类。 – 2015-05-17 11:07:45

0
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 
    <ImageView 
     android:id="@+id/ImageView" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/ic_launcher"/> 
    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_marginTop="26dp"> 
     <TextView 
       android:id="@+id/textView1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="26dp" 
       android:text="@string/blablabla" /> 
    </ScrollView> 
</LinearLayout>