小编Abd*_*hçı的帖子

更改广告的可见性后,Scrollview会自动滚动

我有一个ScrollView包含Textview,Imageview,Webview和粘PublisherAdView在的底部RelativeLayout包含我ScrollViewPublisherAdView.

我的广告的能见度GONE为默认值,但在广告加载后,我改变的知名度PublisherAdViewVISIBLE.

问题是当我改变可见性时,我的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)

android visibility scrollview admob

2
推荐指数
1
解决办法
1806
查看次数

标签 统计

admob ×1

android ×1

scrollview ×1

visibility ×1