Android 如何删除线性布局阴影?
我的布局如下: XML代码:Android 如何删除线性布局阴影?,android,android-actionbar,android-linearlayout,Android,Android Actionbar,Android Linearlayout,我的布局如下: XML代码: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://sch
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
tools:context=".Activities.OwnerProfileActivity">
<LinearLayout
android:id="@+id/linear_layout_profile_top"
android:layout_width="0dp"
android:layout_height="165dp"
android:background="@color/colorPrimary"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<View
android:layout_width="match_parent"
android:layout_height="20dp" />
<ImageView
android:id="@+id/imageView_profile_picture"
style="@style/ProfileImageStyle"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_user" />
<TextView
android:id="@+id/textView_user_name"
style="@style/UserNameLabelStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="TextView"
android:textSize="18sp" />
</LinearLayout>
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linear_layout_profile_top"
app:tabSelectedTextColor="@color/colorPrimary">
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_label" />
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/businesses_label" />
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/coupons_label" />
</android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager_page"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toTopOf="@+id/lower_navigation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tabLayout"
app:layout_constraintVertical_bias="1.0" />
<fragment
android:id="@+id/lower_navigation"
android:name="com.nprogramming.android.couponsapp.Fragments.LowerNavigationBarFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</android.support.constraint.ConstraintLayout>
如何消除操作栏和LinearLayout红色块之间的阴影
提前感谢。在创建OwnerProfileActivity时将此代码添加到您的方法中
ifgetSupportActionBar!=null{getSupportActionBar.setElevation0;}这是ActionBar下的阴影。如果要更改,您需要定义自己的: