小编jal*_*aas的帖子

改变黑暗与轻巧的键盘iOS7

在iOS7中,我们有黑暗和轻巧的键盘.我可以通过代码在我的应用程序之间进行更改吗?黑暗的键盘 轻键盘

keyboard tint ipad ios

15
推荐指数
1
解决办法
5296
查看次数

UIView在灰度.查看未重绘

我设法通过在顶部添加以下视图来获得灰度级的UIView:

@interface GreyscaleAllView : UIView

@property (nonatomic, retain) UIView *underlyingView;

@end

@implementation GreyscaleAllView

@synthesize underlyingView;

- (void)drawRect:(CGRect)rect {

    CGContextRef context = UIGraphicsGetCurrentContext();

    // draw the image
    [self.underlyingView.layer renderInContext:context];

    // set the blend mode and draw rectangle on top of image
    CGContextSetBlendMode(context, kCGBlendModeColor);
    CGContextSetRGBFillColor(context, 0.0, 0.0, 0.0, 1.0);
    CGContextFillRect(context, rect);
    [super drawRect:rect];
}

@end
Run Code Online (Sandbox Code Playgroud)

它工作正常,但除非我手动调用setNeedsDisplay,否则内容不会更新.(我可以按下UIButton并触发动作,但外观没有任何变化)因此,为了表现得像预期的那样,我每秒调用setNeedsDisplay 60次.我究竟做错了什么?

更新:

viewcontroller在overlayview中使用:

- (void)viewDidLoad
{
    [super viewDidLoad];

    GreyscaleAllView *grey = [[[GreyscaleAllView alloc] initWithFrame:self.view.frame] autorelease];
    grey.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    grey.userInteractionEnabled = NO;    
    [self.view addSubview:grey];
} …
Run Code Online (Sandbox Code Playgroud)

uiview grayscale ios

5
推荐指数
1
解决办法
1183
查看次数

标签 统计

ios ×2

grayscale ×1

ipad ×1

keyboard ×1

tint ×1

uiview ×1