UISegmentedControl自定义背景图片 [英] UISegmentedControl custom background image

查看:660
本文介绍了UISegmentedControl自定义背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有UINavigationBar设置为图像 - 一些木材纹理。我想插入UISegmentedControl有4个按钮在那个吧。按钮应具有相同的纹理,略有变化的色调。

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.

一种解决方法是更改​​按钮背景颜色的tint alpha,以便背景中的纹理可以通过,但是当我在IB中为色调设置alpha时,保存值,它总是返回值1.

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.

我无法得到UISegmentedControl显示背景图片,所以终于放弃了,决定搜索帮助...
所需的效果是iBooks应用程序中的一个,在导航栏中有按钮。
任何链接或小帮助将不胜感激。

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..

推荐答案

本文描述了所涉及的步骤,并有示例代码: http://idevrecipes.com/2010/12/13/wooduinavigation/

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

这篇关于UISegmentedControl自定义背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆