小编Dro*_*nie的帖子

无法解决:support-media-compat打开文件

升级代码后,出现错误“无法解决:support-media-compat打开文件”。supportlib_version是27.1.1

在此处输入图片说明

android android-gradle-plugin

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

FrameLayout下面的Admob横幅

我在现有项目中创建了一个admob横幅。在相对布局中,我正在调用FrameLayout并在admob横幅的代码下方。但是问题是Admob标语显示在框架布局内容上方。

我的XML代码如下

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:ads="http://schemas.android.com/apk/res-auto">

    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar" />

    <FrameLayout
        android:id="@+id/fragment_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/toolbar"/>

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="SMART_BANNER"
        ads:adUnitId="@string/banner_home_footer"
        ads:background="@color/theme_ads"
        android:layout_alignParentBottom="true">
    </com.google.android.gms.ads.AdView>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

布局

根据admob政策,我们不应将广告置于内容之上。我该如何解决这个问题?

java android admob android-studio

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

ImageButton即使是PNG格式也不显示透明度

我正在创建一个应用程序,它在中心有一个 ImageButton。问题是即使图像是纯 PNG 格式,我也没有在图像按钮内获得透明图像。

我的 Xml 如下

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:ads="http://schemas.android.com/apk/res-auto"

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="switchmode.lteonly.lteonlyswitch.MainActivity"
    tools:showIn="@layout/app_bar_main">

    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/imageButton"
        android:clickable="true"
        android:layout_centerVertical="true"
        android:layout_centerInParent="true"
        android:src="@drawable/myimage"
        android:onClick="onClick"/>


</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

输出布局如下。

在此处输入图片说明

任何想法如何解决这个问题?

xml android android-studio

-1
推荐指数
1
解决办法
3527
查看次数