I want to have a fixed size button
If the text is longer than the width of the button, it should show "tex ..."
How to do it?
You can use Ellipsize, but there is an error. The workaround is to set scrollHorizontally to true and lines to 1. See the following code example:
<Button android:text="Button" android:layout_width="50dp" android:layout_height="wrap_content" android:scrollHorizontally="true" android:lines="1" android:ellipsize="end"> </Button>
Please try entering the code in the button
android:maxLength="5"
aString.length();, , , , aString = aString.substring(0, aString.length() - int); , int aString.length() - , . ... aString.append( "..." );
aString.length();
aString = aString.substring(0, aString.length() - int);
Use a text box instead of a button and use the ellipsize property to get 3 dots. You will also need to listen to the click in text mode so that it functions as a button.
You will also need to use: android: scrollHorizontally = "true" for the appearance of "..." (error in android :-()