Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to customize the segment size and the section title font and size - #170

Closed
gabhisekdev opened this issue Jan 11, 2016 · 7 comments
Closed

Comments

@gabhisekdev
Copy link

I am doing a segmented control using HMsegmentedControl. My title for the segments vary in their length. So my question is that Can I change the font as well as can I wordwrap the titles width to length of my content ? You could check my image attached. For eg - I want the width of car segment be wrapped to its length not more than that.
image

@hackjie
Copy link

hackjie commented Apr 5, 2016

hi, @GABHISEKBUNTY did you find any solution?i met too

@wyangy
Copy link

wyangy commented Apr 7, 2016

I'm looking for a solution for this too...

@gabhisekdev
Copy link
Author

segmentedcontrol2.segmentWidthStyle = HMSegmentedControlSegmentWidthStyleDynamic

This makes the length of the segments to fit to the character length.

@hackjie
Copy link

hackjie commented Apr 26, 2016

@GABHISEKBUNTY but this can't set the segment's position

@gabhisekdev
Copy link
Author

@hackjie Heyy why don't you create your own segmented control ....

here is my github repo link - custom segment

Please try to unzip that via terminal due to some problem in symlink u can't do it by double clicking.

@nishantanthwal
Copy link

It supports advanced title styling with text attributes for font, color, kerning, shadow, etc. Try this (and add more attributes if required)

_segmentedControl.titleTextAttributes = @{NSFontAttributeName : [UIFont systemFontOfSize:16],
                                          NSForegroundColorAttributeName : [UIColor redColor]};

@HeshamMegid
Copy link
Owner

Like @nishantanthwal mentioned, you can customize the text attributes using titleTextAttributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants