mercredi 6 mai 2015

Using button add two texts in android

enter image description here

To achieve this button feel in android I am using the below Xml code. But I think there is aneasy way using button. Can anybody solve my issue as I want to append two text in a single button. My motive is to get rid of this layouts.

<LinearLayout
        android:id="@+id/map_near_by"
        android:layout_width="125dp"
        android:layout_height="40dp"
        android:background="@drawable/map_roundcorners"
        android:gravity="center">

        <TextView
            android:id="@+id/nearby_font"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/map_nav_icon"
            android:textColor="@color/text_white"
            android:textSize="@dimen/Text_size_25" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/Margin_10"
            android:text="Nearby"
            android:textColor="@color/text_white" />
    </LinearLayout>

Aucun commentaire:

Enregistrer un commentaire