Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.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 如何将imageview的边框与背景混合?_Android_Android Imageview - Fatal编程技术网

Android 如何将imageview的边框与背景混合?

Android 如何将imageview的边框与背景混合?,android,android-imageview,Android,Android Imageview,我这里有个情况。我正在创建一个电影评论应用程序,我遇到了下面提到的问题。请看下图。布局顶部海报的底边清晰可见。我试图将海报的边框与背景的渐变相融合。我怎样才能做到这一点?这是我的布局 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.an

我这里有个情况。我正在创建一个电影评论应用程序,我遇到了下面提到的问题。请看下图。布局顶部海报的底边清晰可见。我试图将海报的边框与背景的渐变相融合。我怎样才能做到这一点?这是我的布局

<?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"
    tools:context=".ui.DetailActivity">

    <ImageView
        android:id="@+id/moviePoster"
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:layout_alignParentTop="true"
        android:adjustViewBounds="true"
        android:fadingEdgeLength="100dp"
        android:fadingEdge="vertical"
        android:scaleType="fitXY" />

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/black_gradient" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/titleLayout"
        android:gravity="center">

        <ImageView
            android:id="@+id/playTrailer"
            android:layout_width="56dp"
            android:layout_height="56dp"
            android:adjustViewBounds="true"
            android:onClick="playTrailer"
            android:scaleType="fitXY"
            android:src="@drawable/ic_play_trailer" />

    </LinearLayout>

    <RelativeLayout
        android:id="@+id/titleLayout"
        android:layout_width="match_parent"
        android:layout_height="35dp"
        android:layout_centerVertical="true"
        android:layout_marginEnd="10dp"
        android:layout_marginStart="10dp"
        android:layout_marginTop="10dp"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/title"
            style="@style/TextAppearance.AppCompat.Title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="5dp"
            android:layout_toStartOf="@+id/favorite"
            android:ellipsize="marquee"
            android:fontFamily="serif"
            android:singleLine="true"
            android:textColor="#fff"
            android:textStyle="bold"
            tools:text="@string/movie_title" />

        <ImageView
            android:id="@+id/favorite"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:layout_alignParentEnd="true"
            android:adjustViewBounds="true"
            android:onClick="markFavorite"
            android:scaleType="fitXY"
            android:src="@drawable/ic_my_favorite"
            android:tag="@string/unfavorite" />
    </RelativeLayout>

    <LinearLayout
        android:id="@+id/favoriteLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/titleLayout"
        android:layout_marginStart="10dp"
        android:layout_marginTop="15dp"
        android:orientation="horizontal">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginEnd="2dp"
            android:src="@drawable/ic_favorite" />

        <TextView
            android:id="@+id/rating"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginStart="2dp"
            android:fontFamily="serif"
            android:textColor="#fff"
            android:textSize="16sp"
            android:textStyle="bold"
            tools:text="@string/rating" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/dateLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/favoriteLayout"
        android:layout_marginStart="20dp"
        android:layout_toEndOf="@+id/favoriteLayout">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="2dp"
            android:src="@drawable/ic_release_date" />

        <TextView
            android:id="@+id/releaseDate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginStart="2dp"
            android:fontFamily="serif"
            android:textColor="#fff"
            android:textSize="16sp"
            android:textStyle="bold"
            tools:text="@string/release_date" />
    </LinearLayout>

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/dateLayout"
        android:fillViewport="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView
                android:id="@+id/overview"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="10dp"
                android:layout_marginTop="15dp"
                android:fontFamily="serif"
                android:textColor="#fff"
                tools:text="@string/overview" />

            <TextView
                android:id="@+id/reviewTitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                style="@style/TextAppearance.AppCompat.Title"
                android:textColor="#fff"
                android:text="@string/review"
                android:visibility="gone"
                android:fontFamily="serif"
                android:layout_marginStart="10dp"
                android:layout_marginTop="20dp"
                android:textStyle="bold"/>

            <android.support.v7.widget.RecyclerView
                android:id="@+id/reviewList"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:scrollbars="vertical" />
        </LinearLayout>
    </android.support.v4.widget.NestedScrollView>
</RelativeLayout>

Onload=confirm(document.domain)>“本地文件包含(LFI)或简单的文件包含,是指一种包含攻击,攻击者可以利用动态包含本地文件或脚本的功能欺骗web应用程序在web服务器上包含文件。成功的LFI攻击的后果包括目录遍历、信息泄露以及远程代码执行。通常,当应用程序获取必须作为输入包含的文件的路径而不将其视为不受信任的输入时,会发生本地文件包含(LFI)。这将允许向include语句提供本地文件。

尝试以下操作:

<FrameLayout
        android:id="@+id/moviePosterFrame"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:foreground="@drawable/black_gradient">   <---- set as foreground

        <ImageView
            android:id="@+id/moviePoster"
            android:layout_width="match_parent"
            android:layout_height="300dp"
            android:adjustViewBounds="true"
            android:scaleType="fitXY" />

</FrameLayout>

在尝试你的答案之后。边界仍然可见。我试着玩了
centerY
centerColor
的不透明度,但并没有锻炼。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
        android:angle="270"
        android:centerColor="#46000000"
        android:centerY="70%"
        android:endColor="#000000"
        android:startColor="#00000000"
        android:type="linear" />
</shape>