如何防止ScrollView在LinearLayout內容下滾動內容? ScrollView只是使用所有的顯示空間,我不能限制它。 嘗試使用主要的Relative-和LinearLayout。ScrollView在其他內容下滾動
我的代碼:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity" >
<LinearLayout
xmlns:myapp="http://schemas.android.com/apk/res/your.app.package"
android:id="@+id/ad_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</LinearLayout>
<ScrollView
android:id="@+id/ScrollView1"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1" >
<RelativeLayout
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:contentDescription="@string/image"
android:onClick="openImage1"
android:scaleType="fitStart"
android:src="@drawable/loading"
android:adjustViewBounds="true"
android:background="#000000" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
嘿,我已經給小圖像留下底部,滾動視圖默認線性佈局有大數據,所以這個線性數據與圖像重疊,對於更大的屏幕,這不是問題。對於小屏幕這是一個問題(4「屏幕是問題) – Prasad 2014-11-26 07:24:10