Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material Button with icon on the right

Tags:

The new material button from Google is really nice.
According to the documentation, we can set an icon who's shown by default on the left. Does anyone knows how to set it on the right? I can't find anything about this.

like image 580
Benjamin Ledet Avatar asked Jun 11 '18 13:06

Benjamin Ledet


People also ask

How do I add an icon to a material button?

Add icons to the start, center, or end of this button using the app:icon , app:iconPadding , app:iconTint , app:iconTintMode and app:iconGravity attributes. If a start-aligned icon is added to this button, please use a style like one of the ". Icon" styles specified in the default MaterialButton styles.

What is the icon button?

An icon button is a picture printed on a Material widget that reacts to touches by filling with color (ink). Icon buttons are commonly used in the AppBar. actions field, but they can be used in many other places as well. If the onPressed callback is null, then the button will be disabled and will not react to touch.

What is a contained button?

Contained buttons are high-emphasis, distinguished by their use of elevation and fill. They contain actions that are primary to your app. Contained buttons are high-emphasis, distinguished by their use of elevation and fill.


1 Answers

I googled today the same problem and found this: android:layoutDirection="rtl". It works in my test project.

like image 60
Anna Avatar answered Nov 07 '22 17:11

Anna