由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - iOS UITabBarController 问题
相关主题
请问windows平台下在C++里如何把一张图片旋转一个角度ambiguous operators in c++
求个简单的算法so weird (转载)
iOS类似Picasso这样的库哪个最好请问一个多线程与volatile关键字的问题。
问wdong一个问题,学习openGL从哪儿开始学好我来挖坑, 谈谈OOP/FP/SQL和人类思维习惯
有人用storyboard做ios游戏吗? (转载)how to convert GMT to timestamp of the computer's current time
TabBarController的问题求教perl sprintf question converting dec to hex
Business Analyst (greater Los Angeles)用户需要下载网页上动态产生的复杂SVG,如何破?
Opaque type in CVB 图像求助
相关话题的讨论汇总
话题: alpha话题: image话题: rgb话题: white
进入Programming版参与讨论
1 (共1页)
z*y
发帖数: 1311
1
想在Storyboard里修改TabBarItem的image
总是不行,画面是灰色一片(红圈部分)
image本身不大(24X24)
谢谢指点
f*******n
发帖数: 12623
2
https://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/
UITabBarItem_Class/Reference/Reference.html#//apple_ref/occ/instm/
UITabBarItem/initWithTitle:image:tag:
"The alpha values in the source image are used to create the unselected and
selected images—opaque values are ignored."
z*y
发帖数: 1311
3

and
Thanks. But my images do not contain alpha value.

【在 f*******n 的大作中提到】
: https://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/
: UITabBarItem_Class/Reference/Reference.html#//apple_ref/occ/instm/
: UITabBarItem/initWithTitle:image:tag:
: "The alpha values in the source image are used to create the unselected and
: selected images—opaque values are ignored."

f*******n
发帖数: 12623
4
Every pixel in a PNG image has an RGBA (red, green, blue, alpha) value.
Alpha controls the transparency of that pixel. In a "normal" (opaque) image,
every pixel has alpha = 1 (not transparent at all).
Tab bar icons do not care about the RGB parts; only the Alpha. Alpha = 0
means transparent; alpha = 1 means white (when unselected) or blue (when
selected). You can only control the range in between (it's basically like a
"grayscale" image, except in alpha channel instead of RGB). You don't have
control over the colors other than black, white, or gray.
So basically, what you have to do is first make a grayscale (black and white
) image, and then set those black/white values in the alpha channel instead
of in the RGB (RGB will be ignored).

【在 z*y 的大作中提到】
:
: and
: Thanks. But my images do not contain alpha value.

z*y
发帖数: 1311
5
got it, thank you.
try some website that converts to alpha, works!

image,
a
white
instead

【在 f*******n 的大作中提到】
: Every pixel in a PNG image has an RGBA (red, green, blue, alpha) value.
: Alpha controls the transparency of that pixel. In a "normal" (opaque) image,
: every pixel has alpha = 1 (not transparent at all).
: Tab bar icons do not care about the RGB parts; only the Alpha. Alpha = 0
: means transparent; alpha = 1 means white (when unselected) or blue (when
: selected). You can only control the range in between (it's basically like a
: "grayscale" image, except in alpha channel instead of RGB). You don't have
: control over the colors other than black, white, or gray.
: So basically, what you have to do is first make a grayscale (black and white
: ) image, and then set those black/white values in the alpha channel instead

z*y
发帖数: 1311
6
想在Storyboard里修改TabBarItem的image
总是不行,画面是灰色一片(红圈部分)
image本身不大(24X24)
谢谢指点
f*******n
发帖数: 12623
7
https://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/
UITabBarItem_Class/Reference/Reference.html#//apple_ref/occ/instm/
UITabBarItem/initWithTitle:image:tag:
"The alpha values in the source image are used to create the unselected and
selected images—opaque values are ignored."
z*y
发帖数: 1311
8

and
Thanks. But my images do not contain alpha value.

【在 f*******n 的大作中提到】
: https://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/
: UITabBarItem_Class/Reference/Reference.html#//apple_ref/occ/instm/
: UITabBarItem/initWithTitle:image:tag:
: "The alpha values in the source image are used to create the unselected and
: selected images—opaque values are ignored."

f*******n
发帖数: 12623
9
Every pixel in a PNG image has an RGBA (red, green, blue, alpha) value.
Alpha controls the transparency of that pixel. In a "normal" (opaque) image,
every pixel has alpha = 1 (not transparent at all).
Tab bar icons do not care about the RGB parts; only the Alpha. Alpha = 0
means transparent; alpha = 1 means white (when unselected) or blue (when
selected). You can only control the range in between (it's basically like a
"grayscale" image, except in alpha channel instead of RGB). You don't have
control over the colors other than black, white, or gray.
So basically, what you have to do is first make a grayscale (black and white
) image, and then set those black/white values in the alpha channel instead
of in the RGB (RGB will be ignored).

【在 z*y 的大作中提到】
:
: and
: Thanks. But my images do not contain alpha value.

z*y
发帖数: 1311
10
got it, thank you.
try some website that converts to alpha, works!

image,
a
white
instead

【在 f*******n 的大作中提到】
: Every pixel in a PNG image has an RGBA (red, green, blue, alpha) value.
: Alpha controls the transparency of that pixel. In a "normal" (opaque) image,
: every pixel has alpha = 1 (not transparent at all).
: Tab bar icons do not care about the RGB parts; only the Alpha. Alpha = 0
: means transparent; alpha = 1 means white (when unselected) or blue (when
: selected). You can only control the range in between (it's basically like a
: "grayscale" image, except in alpha channel instead of RGB). You don't have
: control over the colors other than black, white, or gray.
: So basically, what you have to do is first make a grayscale (black and white
: ) image, and then set those black/white values in the alpha channel instead

e***t
发帖数: 78
11
请问您在哪个网站转的?谢谢!

【在 z*y 的大作中提到】
: got it, thank you.
: try some website that converts to alpha, works!
:
: image,
: a
: white
: instead

1 (共1页)
进入Programming版参与讨论
相关主题
VB 图像求助有人用storyboard做ios游戏吗? (转载)
How to kill a window without title?TabBarController的问题求教
缩小图象的程序Business Analyst (greater Los Angeles)
彩色图像创建和显示问题Opaque type in C
请问windows平台下在C++里如何把一张图片旋转一个角度ambiguous operators in c++
求个简单的算法so weird (转载)
iOS类似Picasso这样的库哪个最好请问一个多线程与volatile关键字的问题。
问wdong一个问题,学习openGL从哪儿开始学好我来挖坑, 谈谈OOP/FP/SQL和人类思维习惯
相关话题的讨论汇总
话题: alpha话题: image话题: rgb话题: white