影に問題があります。アンドロイドStudioのプレビューで示していますレイアウトで影が動かないAndroid
が、エミュレータで、私が見る電話で:
私のxmlがあります:
<LinearLayout
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=".Profil"
android:background="@color/lightback"
android:orientation="vertical">
<FrameLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/testFragmentu2"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:translationZ="10dp"
android:background="@android:color/transparent"></FrameLayout>
<FrameLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="175dp"
android:id="@+id/testFragmentu"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:translationZ="0dp"
android:background="@android:color/transparent"
android:layout_marginTop="10dp"></FrameLayout>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="150dp"
android:translationZ="10dp"
android:background="@android:color/transparent"
android:layout_marginTop="10dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right|top"
android:background="@android:color/transparent">
<TextView android:id="@id/android:empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Niestety, wszyscy mają partnerów na siłownię... :(" />
<ListView android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="false" />
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
私は3つのフレグメンを作りようとしていますts。 3つ目の断片をクリックすると、そのうち2つが上から表示されます。しかし、影はありません。
app:elevation="10dp"
の代わりに、アンドロイドdocsで述べたようにtranslationZ
、elevation
:
仰角のCardViewを使用してください –
あなたがテストしているアンドロイドバージョンはありますか? –
API23。私はCardViewを使いたくありません。 – Magnus2005