简体   繁体   中英

Using material design, how to programmatically create a Material Button?

I know how to create a normal button and textview programmtically. However, the documentation for Material design components is a bit lacking. How would I dynamically create a Material Button (and other Material Design components)?

Was referring to the official documentation here but it only shows xml creation. Seems like it should be fairly straightforward but I haven't found anything on google / stackoverflow covering this.

You need to add proper dependency. Check this link Then you can create it as average view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM