I wrote a phone dialer program for a boyfriend to play, used to hit my mobile phone number, in order to make the interface look good, you need to display two lines of text button. Two methods were collected on the internet and recorded in the following. To share with you, hoping to help the people who need it.
method One:
<linearlayout
Android:id= "@+id/container"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
tools:context= "Com.example.test.MainActivity"
Tools:ignore= "Mergerootframe"
android:clickable= "true"
android:focusable= "true"
android:orientation= "Vertical"
android:background= "@android:d rawable/btn_default">
<textview
android:text= "Hello"
Android:layout_width= "Wrap_content"
Android:gravity= "Center_horizontal"
android:layout_height= "Wrap_content"
android:layout_weight= "1"/>
<textview
Android:text= "Android"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_gravity= "Center_horizontal"
android:layout_weight= "1"/>
</LinearLayout>
effects such as:
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbglhbmdjywl5dw4ymdez/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">
Because I was just beginning to learn, with such a method when did not think of the way to bind the listener, hoping to pass the great God pointing twos.
Method Two:
<buttton
Android:id= "@+id/button1"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:textcolor= "#FF0000"
Android:textsize= "20SP"
android:text= "Call the girl & #10; (China Unicom) "/>
The way to do this is with "& #10;" This symbol implements a button that displays two lines of text so that the listener can be bound to the button
However, when used, it is assumed that both ends of the symbol are "@string/..." and an error is made.
This is a note. I hope to be useful to you
Android App Development button displays two lines of text