2017-02-23 2 views
0

Ich erstelle eine Android-App für unser Capstone-Projekt. Ich benutze API 23. Ich füge die Höhe meiner Symbolleisten und anderer Komponenten hinzu, aber die Schatten erscheinen nicht. Ist es mein Thema, das es ruiniert?Höhe/Schatten funktioniert nicht in meiner App

Wenn ich versuche, die Symbolleiste einzubeziehen, dann führe das Programm auf meinem Telefon/Emulator aus, der Schatten wird nicht angezeigt. sogar mit cardview

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/activity_login" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="capstoreit.capstoreit.Login.Login" 
    android:background="@drawable/login_bg"> 


    <!--Layout for Login and Signup--> 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 

     android:layout_alignParentTop="true" 
     android:layout_alignParentStart="true"> 

     <android.support.design.widget.AppBarLayout 
      android:id="@+id/appbar" 
      android:layout_width="match_parent" 
      android:elevation="10dp" 
      android:layout_height="wrap_content"> 


    <!--Toolbar--> 
    <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:local="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/login_toolbar" 
     android:layout_width="match_parent" 
     android:elevation="10dp" 
     local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
     local:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
     android:layout_height="?attr/actionBarSize" 
     android:background="@color/colorPrimary"> 

     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:src="@drawable/new_logo" 
      android:adjustViewBounds="true" 
      android:padding="5dp" 
      android:id="@+id/app_logo" /> 

    </android.support.v7.widget.Toolbar> 

    <!--Tab--> 
     <android.support.design.widget.TabLayout 
      android:id="@+id/tabs" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      app:tabMode="fixed" 
      app:tabGravity="fill" 
      android:elevation="10dp" 
      android:background="@color/textColorPrimary" 
      app:tabSelectedTextColor="@color/colorAccent" 
      /> 
</android.support.design.widget.AppBarLayout> 


     <android.support.v4.view.ViewPager 
      android:id="@+id/viewpager" 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="0.8" 
      app:layout_behavior="@string/appbar_scrolling_view_behavior" 
      android:layout_alignParentStart="true" 
      > 
     </android.support.v4.view.ViewPager> 

     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="0dp" 
      android:layout_weight="0.2" 
      /> 



    </LinearLayout> 


</RelativeLayout> 

Screenshot:

enter image description here

Nach dem App zu ändern: Höhen enter image description here

+2

versuchen 'App: elevation' anstatt' android: Höhen ' –

Antwort

1

konnte ich meine erro beheben, indem diese auf meinem Android-Manifest zu entfernen:

 android:hardwareAccelerated="false" 
0

Verwendung dieses, wenn Sie Support-Bibliothek verwenden auch für ältere Versionen

app:elevation 

verwenden diese, wenn Sie nicht mit Support-Bibliothek

android:elevation 
+0

funktioniert immer noch nicht –

Verwandte Themen