如何裁剪我的UIPickerView?

时间:2012-06-29 04:29:18

标签: xcode uipickerview crop

这是我的横向UIPickerView(通过旋转和扩展ori UIpicker):htp://s7.postimage.org/qzez9d0pn/Original.png

现在,我想要做的就是切断这两个空格:http://s7.postimage.org/bryzp08uz/Process.png

要获得更好的效果:http://s7.postimage.org/6ulf3w6vv/Result.png

有人请帮我怎么做......?

我的旋转&比例代码:

thePickerView.delegate = self;
thePickerView.showsSelectionIndicator =YES;
thePickerView.center = CGPointMake(xVar, yVar); // position
CGAffineTransform rotate = CGAffineTransformMakeRotation(-3.14/2); // rotate
rotate = CGAffineTransformScale(rotate, 0.1, 1); // scale
[thePickerView setTransform:rotate];

UILabel *theview[num]; 
CGAffineTransform rotateItem = CGAffineTransformMakeRotation(3.14/2);

for (int i=0;i<num;i++) {  
    theview[i] = [[UILabel alloc] init];
    theview[i].text = [NSString stringWithFormat:@"%d",i+1];
    theview[i].textColor = [UIColor blackColor];
    theview[i].frame = CGRectMake(0,0, 100, 100);
    theview[i].backgroundColor = [UIColor clearColor];
    theview[i].textAlignment = UITextAlignmentCenter;
    theview[i].shadowColor = [UIColor whiteColor];
    theview[i].shadowOffset = CGSizeMake(-1,-1);
    theview[i].adjustsFontSizeToFitWidth = YES;

    theview[i].transform = CGAffineTransformScale(rotateItem, 1, 10);
}
itemArray = [[NSMutableArray alloc] init];
for (int j=0;j<num;j++) {[itemArray addObject:theview[j]];}
[thePickerView selectRow:row inComponent:0 animated:NO];
[self.view addSubview:thePickerView];

1 个答案:

答案 0 :(得分:0)

我在搜索时的临时解决方案等待更好的编码答案是创建一个叠加背景图像然后透明PickerView =。=

的欲望空间