2016-08-12 4 views
5

Hallo entfernen gerne tun: ziehbar/draw_arc_corner_shapeWie diese Grenze auf Layout ich würde

<shape 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:shape="rectangle" > 

<solid 
    android:color="@color/bg_trip_tab_view" > 
</solid> 

<!--<stroke--> 
    <!--android:width="0dp"--> 
    <!--android:color="@color/bg_trip_tab_view" >--> 
<!--</stroke>--> 

<padding 
    android:left="0dp" 
    android:top="5dp" 
    android:right="0dp" 
    android:bottom="5dp" > 
</padding> 

<corners 
    android:radius="11dp" > 
</corners> 

: enter image description here

Und meine Lösung für Linearlayout

dieser Satz Ecke

Dieser Teil DWAW-Kreis: ziehbar/draw_circle_shape

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="oval" 
    android:useLevel="false" > 
    <solid android:color="@color/bg_my_trip_tab_view" /> 
    <size 
     android:height="10dp" 
     android:width="10dp" /> 
</shape> 

dieses Unentschieden gestrichelte Linie: ziehbar/draw_dash_line_shape

<?xml version="1.0" encoding="utf-8"?> 
    <shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="line" > 
    <stroke 
     android:dashGap="3dp" 
     android:dashWidth="2dp" 
     android:width="1dp" 
     android:color="@color/bg_my_trip_tab_view" /> 
</shape> 

und hier erstellen Ansicht (Separator) mit Kreis (Halbkreis) am Anfang und Ende und Strich-Linie zwischen : Layout/Separator

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="horizontal" 
android:gravity="center_vertical" 
android:layout_alignParentBottom="true"> 

<View 
    android:layout_width="20dp" 
    android:layout_height="20dp" 
    android:layout_marginLeft="-10dp" 
    android:background="@drawable/draw_circle_shape" 
    /> 

<View 
    android:layout_width="0dp" 
    android:layout_height="5dp" 
    android:background="@drawable/draw_dash_line_shape" 
    android:layerType="software" 
    android:layout_weight="1" 
    android:paddingRight="15dp" 
    /> 

<View 
    android:layout_width="20dp" 
    android:layout_height="20dp" 
    android:layout_marginRight="-10dp" 
    android:background="@drawable/draw_circle_shape" 
    /> 
</LinearLayout> 

und hier verwende ich es: Layout/main_screen

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
android:background="@color/bg_my_trip_tab_view" 
> 
<LinearLayout 
    android:id="@+id/linearLayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp" 
    android:layout_marginTop="10dp" 
    android:layout_marginBottom="10dp" 
    android:background="@drawable/draw_arc_corner_shape" 
    > 
    <include 
     android:layout_marginTop="@dimen/grid_20" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     layout="@layout/separator" 

     /> 
</LinearLayout> 

und das ist mein Ergebnis: enter image description here

Und meine Frage: Wie kann ich Grenze mit Schatten entfernen? Und wie kann ich es besser machen?

+0

Mögliche Lösung: Ich kann Bild 9-Pfad verwenden ... aber ich will nicht .. –

+0

versuchen, android hinzuzufügen: stateListAnimator = "@ null" in Ihrem main_screen Lineares Layout – USKMobility

+0

Hey, ich habe dein Layout getestet und didn Ich bekomme wirklich keine Schatten in API 19 und API 24 ... – Shaishav

Antwort

0

Erhalten Sie Randschatten in Android Studio XML-Entwurfsansicht. Auf echtem Gerät kein Schatten.

+0

Ihr lineares Layout haben einige Eltern wie Kartenansicht? – Ramit

+0

Ich teste es auf realen Gerät und es gibt Schatten –

+0

Sie verwenden keine Eltern des linearen Layouts wie Cardview usw. Das kann Schatten haben. – Ramit

Verwandte Themen