-2

Ich möchte vertikale Linie in unter Layout hinzufügen, aber ich bin verwirrt, wie Sie es hinzufügen. Da meine Anforderung am Ende der Verticallinie liegt, gibt es eine Schaltfläche.Wie wird eine vertikale Linie für das untere Layout hinzugefügt?

meine anforderung ist wie unten bild. My requirement:show Image

Ich habe meine Layout-Code angebracht und ich erhalte diese Ausgabe: show image

Bitte jemand mir helfen, die Lösung zu finden.

Mein Layout-Code:

<?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="wrap_content" 
    android:background="?android:attr/selectableItemBackground" 
    android:clickable="true" 
    android:focusable="true" 
    android:orientation="horizontal" 
    android:paddingBottom="10dp" 
    android:paddingLeft="10dp" 

    android:paddingRight="10dp" 
    android:paddingTop="10dp"> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="?android:attr/selectableItemBackground" 
     android:clickable="true" 
     android:focusable="true" 
     android:orientation="vertical" 
     android:paddingBottom="10dp" 
     android:paddingLeft="16dp" 

     android:paddingRight="16dp" 
     android:paddingTop="10dp"> 

     <TextView 
      android:id="@+id/title" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true" 
      android:text="20% OFF" 
      android:textColor="@color/title" 
      android:textSize="25dp" 
      android:textStyle="bold" /> 

     <TextView 
      android:id="@+id/genre" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/title" 
      android:textSize="13dp" 
      android:text="Max.Discount : $150" /> 

     <TextView 
      android:id="@+id/year" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/genre" 
      android:textSize="13dp" 
      android:text="Expiry on : 8 Nov 2017" 
      android:textColor="@color/year" /> 
    </RelativeLayout> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentTop="true" 
     android:background="?android:attr/selectableItemBackground" 
     android:clickable="true" 
     android:focusable="true" 
     android:orientation="vertical" 
     android:paddingBottom="10dp" 
     android:paddingLeft="16dp" 
     android:paddingRight="16dp" 
     android:paddingTop="10dp"> 

     <TextView 
      android:id="@+id/maxdiscount" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:paddingRight="15dp" 
      android:paddingTop="4dp" 
      android:textSize="16dp" 
      android:text="RAINY20" 
      android:textColor="@color/year" /> 

     <Button 
      android:id="@+id/button" 
      android:layout_width="wrap_content" 
      android:layout_height="40dp" 

      android:text="Apply" 
      android:layout_below="@+id/maxdiscount" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentEnd="true" /> 
    </RelativeLayout> 
</RelativeLayout> 
+0

@IntelliJAmiya: Ja, ich habe das gelöst. Ich habe dem Android eine vertikale Linienansicht hinzugefügt: layout_toLeftOf = "@ + id/btn_apply" – Sanket

Antwort

0

Schließlich habe ich die Lösung gefunden. ich hinzugefügt Ansicht vertikale Linie mit android:layout_toLeftOf="@+id/button"

und

für Abwärtspfeiltaste verwenden, um die android:layout_alignBottom="@+id/verticalline" und android:layout_alignRight="@+id/verticalline" Eigenschaften. Mein Problem ist gelöst. :)

Verwandte Themen