0

enter image description hereZiehungslinie zwischen zwei Drawables in der Textviews

Ich habe das Problem mit Ziehlinie wie in einem oben pic. Wie kann ich das machen? Hier ist der Code der Ansicht, wo ich das umsetzen muss. Ich nehme an, ich brauche Leinwand, aber ich bin mir da nicht sicher. Danke für jeden Hinweis!

<RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:layout_marginTop="@dimen/linear_layout_buttons_margin_top" 
     android:orientation="vertical"> 

     <TextView 
      android:id="@+id/button_from_city" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginBottom="4dp" 
      android:layout_marginLeft="60dp" 
      android:layout_marginRight="60dp" 
      android:layout_marginTop="4dp" 
      android:background="@drawable/button_white" 
      android:drawableLeft="@drawable/ic_green" 
      android:drawablePadding="@dimen/dots_white_button_padding" 
      android:drawableStart="@drawable/ic_green" 
      android:gravity="center_vertical" 
      android:hint="@string/from_place" 
      android:padding="@dimen/dots_white_button_padding" 
      android:textColor="@color/color_accent" 
      android:textColorHint="@color/text_view_hint_color"/> 

     <TextView 
      android:id="@+id/button_to_city" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/button_from_city" 
      android:layout_marginBottom="4dp" 
      android:layout_marginLeft="60dp" 
      android:layout_marginRight="60dp" 
      android:layout_marginTop="4dp" 
      android:background="@drawable/button_white" 
      android:drawableLeft="@drawable/ic_red" 
      android:drawablePadding="@dimen/dots_white_button_padding" 
      android:drawableStart="@drawable/ic_red" 
      android:gravity="center_vertical" 
      android:hint="@string/to_place" 
      android:padding="@dimen/dots_white_button_padding" 
      android:textColor="@color/color_accent" 
      android:textColorHint="@color/text_view_hint_color"/> 
    </RelativeLayout> 

Antwort

1

können Sie bieten zwei ziehbar Ressourcen für die Textviews und sie als drawableStart, basierend auf den erforderlichen Bedingungen Ihrer Arbeit. Der Punkt hier ist ein Bild, das einen farbigen Kreis und eine Linie enthält, was viel einfacher ist, als das Layout mit Leinwand zu zeichnen.

0

Ich werde einfach zwei Ansicht mit grauem Hintergrund von 1 dp Breite über und unter Ihrem Punkt zeichnen und verwalten Sichtbarkeit abhängig von der Position Ihrer Artikel.

Verwandte Themen