有没有人设法为UISearchBar的scopebar部分着色,它有一个tintColor属性,但设置它不会影响附加的scopebar UISegmentedControl.我在酒吧有一个把它染色的手柄,但似乎没有工作,即:
for (id subview in searchBar.subviews){
if([subview isMemberOfClass:[UISegmentedControl class]]){
UISegmentedControl *scopeBar=(UISegmentedControl *) subview;
scopeBar.tintColor=UIColorFromRGB(0x990066);
}
}
Run Code Online (Sandbox Code Playgroud)
干杯,尼尔
在Objective-C中是否可以查看某个int值是否在某个特定值enum?例如,在这个枚举中:
enum {
ValidationLoginFailed = 2000,
ValidationSessionTokenExpired = 2001,
ValidationSessionTokenInvalid = 2002,
ValidationEmailNotFound = 2003
};
typedef int ValidationStatusCodes;
Run Code Online (Sandbox Code Playgroud)
有可能看到一个任意整数值是ValidationStatusCodes enum?
[ValidationStatusCodes contains:intResponseCode]
Run Code Online (Sandbox Code Playgroud)
或至少
[self intIsInRangeofEnum:ValidationStatusCodes forValue:intResponseCode]
Run Code Online (Sandbox Code Playgroud)