Two Texts on a Single Button in Android? -


i have button in android studio:

<button     android:layout_width="match_parent"     android:layout_height="match_parent"     android:text="event name (23)" /> 

it looks this:

------------------------------------- | event name (23)                   | ------------------------------------- 

what 2 pieces of text in single button.

basically, want on left side of button, name of event... want on right side of button have number of people registered event, looks this:

------------------------------------- | event name                   (23) | ------------------------------------- 

is possible?

i new android, keep in mind.

you can create layout instead of button , perform click event on layout.

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:padding="15dp"     android:id="@+id/rellayout">      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="event name"         android:layout_alignparentleft="true"         android:textsize="16sp"/>      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentright="true"         android:text="(23)"         android:textsize="16sp"/>  </relativelayout> 

in activity :

relativelayout rellayout = (relativelayout) findviewbyid(r.id.rellayout);          rellayout.setonclicklistener(new view.onclicklistener() {             @override             public void onclick(view view) {                 // implement login on relativelayout click             }         }); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -