Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISegmentedControl custom background image

I have UINavigationBar setup as image - some wood texture. I want to insert UISegmentedControl with 4 buttons on that bar. Buttons should have same texture with slightly changed tint.

One solution would be to change tint alpha of buttons background color, so that texture in background can get trough, but as I set alpha for tint in IB it doesn't save value, it always gets back to value 1.

I cant get UISegmentedControl to show background image, so finally gave up and decide to search for help... Effect that is desired is one in iBooks app, with buttons in Navigation Bar. Any link or small help would be appreciated..

like image 784
kviksilver Avatar asked Aug 02 '10 09:08

kviksilver


2 Answers

This post describes the steps involved and has sample code: http://idevrecipes.com/2010/12/13/wooduinavigation/

like image 159
Dylan Avatar answered Oct 20 '22 04:10

Dylan


https://github.com/xhan/PlutoLand/blob/master/PlutoLand/UI/PLSegmentView.h

a custom SegmentView that can specify two images(normal, clicked)

like image 33
xhan Avatar answered Oct 20 '22 05:10

xhan