小编Don*_*mer的帖子

iPhone UITableViewCell图层阴影

我正在尝试使用layer.shadowColor,Offset,Radius向UITableViewCell添加阴影,但它似乎不会以任何方式影响它.该表是分组样式.有什么想法吗?

这是我正在使用的代码:

cell.layer.shadowColor= [UIColor blackColor].CGColor;
cell.layer.shadowRadius = 5.0;
cell.layer.shadowOffset = CGSizeMake(10, 10);
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch shadow uitableview

22
推荐指数
3
解决办法
3万
查看次数

我们可以对UITextView采取哪些addTarget操作?

我想在UITextView上使用addTarget:action,如on(UITextField或UIButton).

我想在UITextView上调用一个方法.

请给出一些可能的解决方案

谢谢...

UITextView  *TXT_First_Tag = [[UITextView alloc] initWithFrame:CGRectMake(5, textPosY, 350, 65)];
TXT_First_Tag.backgroundColor = [UIColor whiteColor];
TXT_First_Tag.font = [UIFont fontWithName:@"Arial-BoldMT" size:30.0];
TXT_First_Tag.editable =YES;
TXT_First_Tag.tag = i; 
TXT_First_Tag.textColor = [UIColor blackColor];


[TXT_First_Tag addTarget:self action:@selector(C6Loop) forControlEvents:UIControlEventEditingDidEnd]; //  This Line I want to use, it's working fine on textfield...
[scrollview addSubview:TXT_First_Tag];
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uitextview ios

7
推荐指数
1
解决办法
1万
查看次数

IOS:在视图中绘制图像

我有这个代码在视图中着色:

UITouch *touch = [touches anyObject];   
    CGPoint currentPoint = [touch locationInView:drawImage];

    UIGraphicsBeginImageContext(drawImage.frame.size);
    [drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)];
    CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
    CGContextSetLineWidth(UIGraphicsGetCurrentContext(), size);

      CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), r, g, b, a);

    CGContextBeginPath(UIGraphicsGetCurrentContext());
    CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
    CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
    CGContextStrokePath(UIGraphicsGetCurrentContext());
    drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
Run Code Online (Sandbox Code Playgroud)

我的问题是我想要用点不着色,但我想使用重复的特定图像(作为png图像)是否可能?

xcode png uiimage ios

4
推荐指数
1
解决办法
1万
查看次数

UIView背景图像按比例调整大小

我有一个大小为200*100的Background.png图像,我为uiview设置了背景图像:

    UIView view= UIView alloc] initWithFrame:CGRectMake(50, 100, 200, 100)];
    view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"Background.png"]];
Run Code Online (Sandbox Code Playgroud)

现在,我通过以下方式重置框架UIView:

    [view setFrame:CGRectMake(50,100,400,200)];
Run Code Online (Sandbox Code Playgroud)

我需要按照uiview的比例调整背景图像的大小,但我只有一个固定大小的Background.png图像.我该怎么办.

iphone cocoa-touch objective-c uiview ios

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