2017-01-11 2 views
0
<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    android:id="@+id/RelativeLayout2" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/scrollview1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@drawable/home_background" 
    android:fillViewport="true" 
    > 
     <RelativeLayout 
      android:id="@+id/RelativeLayout1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      > 
      <TableLayout 
       android:id="@+id/tableLayout1" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       > 
       <TableRow 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:paddingTop="50dip" 
        android:gravity="center" 
        > 
        <TextView 
         android:layout_height="wrap_content" 
         android:layout_width="wrap_content" 
         android:textColor="#FFFFFF" 
         android:text="text" 
         /> 
        <TextView 
         android:layout_height="wrap_content" 
         android:layout_width="wrap_content" 
         android:textColor="#FFFFFF" 
         android:text="text" 
         /> 
       </TableRow> 
       .... 
      </TableLayout> 
     </RelativeLayout> 
</ScrollView> 
    <ImageView 
     android:id="@+id/logo" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:src="@drawable/logo" 
     android:layout_alignParentBottom="true" 
    /> 
</RelativeLayout> 

ここでは、一番下のテーブル行とロゴのあるスクロールビューがあります。ロゴはテーブルの上に重なります。スクロールビューの下に移動するにはどうしたらいいですか?私はすでにscrollviewが画像の背景を持っているのでしかし、これは、ロゴを隠しスクロールビューで画像の背景を持つzindexを設定する方法

view.bringToFront(); 

view.setTranslationZ(-10); 

で試してみました。

答えて

0
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    android:id="@+id/RelativeLayout2" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/scrollview1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@mipmap/ic_launcher" 
     android:fillViewport="true" 
     > 
     <LinearLayout 
      android:id="@+id/RelativeLayout1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      > 
      <TableLayout 
       android:id="@+id/tableLayout1" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       > 
       <TableRow 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:paddingTop="50dip" 
        android:gravity="center" 
        > 
        <TextView 
         android:layout_height="wrap_content" 
         android:layout_width="wrap_content" 
         android:textColor="#FFFFFF" 
         android:text="text" 
         /> 
        <TextView 
         android:layout_height="wrap_content" 
         android:layout_width="wrap_content" 
         android:textColor="#FFFFFF" 
         android:text="text" 
         /> 
       </TableRow> 
       .... 
      </TableLayout> 
     </LinearLayout> 
    </ScrollView> 
    <ImageView 
     android:id="@+id/logo" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:src="@mipmap/ic_launcher" 
     android:layout_alignParentBottom="true" 
     /> 
</LinearLayout> 
関連する問題