我有一个ScrollView
包含Textview
,Imageview
,Webview
和粘PublisherAdView
在的底部RelativeLayout
包含我ScrollView
和PublisherAdView
.
我的广告的能见度GONE
为默认值,但在广告加载后,我改变的知名度PublisherAdView
来VISIBLE
.
问题是当我改变可见性时,我的ScrollView
自动滚动到某个位置,我不希望这样.
我怎样才能解决这个问题?
这是我的布局
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/windowBackground">
<LinearLayout
android:layout_above="@+id/ad_view_sticky"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/windowBackground"
android:orientation="vertical">
<LinearLayout
android:id="@+id/container_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
</LinearLayout>
<ScrollView
android:id="@+id/scroller"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:id="@+id/news_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/windowBackground"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/main_text_color"
android:textSize="24sp"
android:textStyle="bold"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="5dp" />
<TextView
android:id="@+id/spot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/main_text_color" …
Run Code Online (Sandbox Code Playgroud)