简体   繁体   中英

Using Button To Change TextView Size

I'm new to this but I have some understanding. Currently I have an app that consists of lots of TextViews with a specific size , however i want to be able to implement a Button able change the TextView size of a TextView or all TextViews. Can I have some help please with this with examples of codes (I prefer java) Thank You!

On click of button you can change layout params of the textview you want to resize as following:

TextView tv=<find>
LayoutParams lp = (LayoutParams) tv.getLayoutParams();
lp2.height = 100;
tv.setLayoutParams(lp);
tv.requestLayout();

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