Is there a way so that you can set both image and title of UISegmentControl
simultaneously, so that image appear next to the title , just like image appear next to title in UIButton
.
I am trying but if I set image of Selected segment of UISegmentControl
then title disappears and if I set title of Selected segment of UISegmentControl
then Image disappears, I want to set both at a time.
The official documentation for
-setImage:forSegmentAtIndex:
saysSo, no, there is no way to do what you want using the image and title properties.
However, there are a few options to accomplish the objective in different ways.
-setContentOffset:forSegmentAtIndex:
to move the title to the side of the background image.