简体   繁体   中英

How to adjust UISegmentedControl font size based on segment width?

I have a UISegmentedControl with "n" number of segments. I need to adjust the font size of a segment button title based on a segment width. How to achieve it?

Example Screen:

在此输入图像描述

TIA!!!

Try this one it might help you segmentedControlName.setWidth(widthvalue, forSegmentAt: segment number you want to change width)

Example segmentedControl.setWidth(150, forSegmentAt: 1)

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