【发布时间】:2016-08-08 23:04:05
【问题描述】:
我正在尝试在容器 main 中创建一个可滚动的选项卡。我正在使图像模糊
但我想显示一半模糊和一半彩色
在第二个中,我想显示模糊背景,另一半显示材料设计颜色“无 alpha”
如何设置 这是我的容器主要代码
<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"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.union.front1.MainActivity"
tools:showIn="@layout/activity_main">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/pager"
android:background="#060606">
<android.support.v4.view.PagerTitleStrip
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:theme="@style/Base.TextAppearance.AppCompat.Widget.ActionBar.Title"
android:id="@+id/title"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_gravity="top"
android:background="#000"
style="@style/AppTheme.my"
android:layout_marginTop="15dp"/>
</android.support.v4.view.ViewPager>
</RelativeLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:id="@+id/imageView"
android:alpha="0.8"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
这是我的片段代码
<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:app="http://schemas.android.com/apk/res-auto"
tools:context="com.example.union.front1.Album"
android:background="#e5060606">
<es.guiguegon.sineview.SineView
android:id="@+id/sine_view_album"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
app:sv_sine_alpha="1"
app:sv_sine_amplitude="25dp"
app:sv_sine_animation_time_millis="2000"
app:sv_sine_color="@color/colorPrimaryDark"
app:sv_sine_periods_to_show="2"
app:sv_sine_phase="1" />
</RelativeLayout>
如何将布局的一半设置为透明,一半设置为强色
【问题讨论】: