Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android layout 出现横幅广告后,旋转按钮(动画)消失_Android Layout_Admob_Android Animation_Android 4.4 Kitkat_Asus - Fatal编程技术网

Android layout 出现横幅广告后,旋转按钮(动画)消失

Android layout 出现横幅广告后,旋转按钮(动画)消失,android-layout,admob,android-animation,android-4.4-kitkat,asus,Android Layout,Admob,Android Animation,Android 4.4 Kitkat,Asus,我的屏幕中央有一个按钮,底部有一个旋转器和横幅广告。该应用程序在我尝试过的任何手机上都能完美运行,在galaxy 10.1平板电脑上也能正常运行。这个按钮就像一个指南针,所以我在设备移动时旋转它。我将其加载到华硕7“800 x 1280的记事本上,在adMob横幅出现之前,它工作得非常好。在这一点上,按钮似乎被覆盖并且不可见。有时,当compas调整其旋转时,按钮会再次闪烁开/关 此应用程序可在5.1、4.4.2版本上运行,并通过了应用商店的启动前测试。我在Studio中使用了虚拟设备,使用了4

我的屏幕中央有一个按钮,底部有一个旋转器和横幅广告。该应用程序在我尝试过的任何手机上都能完美运行,在galaxy 10.1平板电脑上也能正常运行。这个按钮就像一个指南针,所以我在设备移动时旋转它。我将其加载到华硕7“800 x 1280的记事本上,在adMob横幅出现之前,它工作得非常好。在这一点上,按钮似乎被覆盖并且不可见。有时,当compas调整其旋转时,按钮会再次闪烁开/关

此应用程序可在5.1、4.4.2版本上运行,并通过了应用商店的启动前测试。我在Studio中使用了虚拟设备,使用了4.4.4版本的Nexus 7(800 x 1280),它可以正常工作。我无法确定华硕平板电脑中是否有不同之处,或者4.4.4版本中是否存在缺陷

我的布局如下所示:

    <?xml version="1.0" encoding="utf-8"?>
<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="match_parent"
                xmlns:ads="http://schemas.android.com/apk/res-auto"
                android:orientation="vertical"
                android:id="@+id/point"
                tools:context=".MainPlay">


    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        android:layout_alignParentTop="true"
        android:id="@+id/baseView">
    </ImageView>

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        ads:adSize="SMART_BANNER"
        ads:adUnitId="@string/adUnitId"
        tools:layout_gravity="center_horizontal">
    </com.google.android.gms.ads.AdView>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        android:layout_above="@+id/adView"
        android:layout_alignParentTop="true"
        android:id="@+id/bView"
        android:background="@color/clear"
        android:weightSum="1">

        <TextView
            android:id="@+id/filler"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_weight="0.56">
        </TextView>

        <Button
            android:id="@+id/target"
            android:layout_width="300dp"
            android:layout_height="300dp"
            android:background="@drawable/pointer"
            android:gravity="center"
            android:text="@string/shake"
            android:textColor="#FFFFFF"
            android:textSize="18sp" />

        <TextView
            android:id="@+id/filler1"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_weight="0.35">

        </TextView>

        <Spinner
            android:id="@+id/spinner"
            android:layout_width="250dp"
            android:layout_height="60dp"
            android:background="@color/dark_background"
            android:popupBackground="@color/light_background"
            android:layout_gravity="center_horizontal|center"/>

        <TextView
            android:id="@+id/spinnerText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textStyle="italic"
            tools:textColor="@color/myWhite"
            android:layout_weight="0.14"
         />
    </LinearLayout>


</RelativeLayout>

我已尝试重新排列布局,但所有操作均按预期进行。首先放置adview会使其消失在imageview(预期)下。代码在显示广告(loadAd)之前会等待一段时间。如果我不加载广告,按钮将保持良好状态。如果加载下一个广告需要半秒钟,则按钮会短暂出现

有人在任何地方见过这种行为吗?有没有关于如何处理的建议?这可能只是这个设备上的一个问题,但这怎么可能?我怎么知道

多谢各位

编辑:我在Play Store上发现了另一个应用程序,当仅在华硕MeMo Pad 7 LTE上旋转按钮时,该应用程序表现出相同的行为。我发现一些旋转按钮应用程序似乎工作正常

我尝试过许多不同的布局文件,但无论我把广告放在什么级别上,它都会在我旋转按钮后使按钮消失。我尝试过动画实用程序(RotateAnimation)以及9个旧的android库。没有区别


进度(但没有修复):似乎如果我不设置按钮的动画,它将保持可见。我假设当广告出现时,动画代码中的某些内容正在与按钮的Z级别交互。只要我启动动画(通过单击或旋转设备),按钮就会消失。(叹气)

在对相关问题进行了大量搜索之后,我发现当Admob显示时,如何使用以下命令停止闪烁/消失按钮:

adView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);


希望这能有所帮助。

在对相关问题进行了大量搜索之后,我发现当Admob显示时,如何使用以下命令停止闪烁/消失按钮:

adView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);


希望这有帮助。

显示布局边界
布局Insperctor
将对您有所帮助。Azizbekian-感谢您的提示。这两个工具都是非常有用的工具,我还没有找到。不幸的是,布局边界显示所有内容都在正确的位置,而我的按钮上没有任何内容。布局检查器拍摄了一张很棒的快照,看起来很不错当ASUS MemoPad 7的屏幕上没有显示任何按钮时,s正常(广告一出现,偶尔会闪烁。广告出现之前,按钮正常工作,但你可以看到广告将出现的空白区域。我正在尝试嵌套的RelativeLayouts以相同的行为将广告保持在按钮布局下。一个真正的抓挠者-可能是华硕的bug?更新:我发现了两个compass程序。其中一个的行为相同就像我的一样,一个很好用。广告一出现,坏的一个指针就会消失,就像我的应用一样闪烁。任何关于如何接近的帮助都是非常感谢的。发布一个屏幕截图,最好在“显示布局边界”中"模式。
Show layout bound
layout Insperctor
将对您有所帮助。Azizbekian-感谢您的提示。这两个工具都是非常有用的工具,我还没有找到。不幸的是,布局边界显示所有内容都在正确的位置,而我的按钮上没有任何内容。布局检查器拍摄了一个很棒的快照,在ASUS MemoPad 7的屏幕上没有显示任何按钮(广告一出现,偶尔会闪烁。广告出现之前,按钮正常工作,但你可以看到广告将出现的空白区域。我正在尝试嵌套的RelativeLayouts以相同的行为将广告保持在按钮布局下。一个真正的抓挠者-可能是华硕的bug?更新:我发现了两个compass程序。其中一个的行为相同就像我的一样,一个很好用。广告一出现,坏的一个指针就会消失,就像我的应用一样闪烁。任何关于如何接近的帮助都很感激。发布一个屏幕截图,最好是在“显示布局边界”模式下。