似乎UITextAlignmentCenter在iOS 6中已弃用.
我仍然使用它并且效果很好,但它会发出警告.
我怎样才能解决这个问题?
label.textAlignment = UITextAlignmentCenter;
Run Code Online (Sandbox Code Playgroud)
谢谢.
我在iOS 5中收到此错误
-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: unrecognized selector sent to instance 0xa217200
但是,我在iOS 6中没有错误.我该如何解决这个问题?这是我的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"MyCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; /// SIGABRT error
if (!cell)
{
cell = [[UITableViewCell alloc]
initWithStyle: UITableViewCellStyleSubtitle
reuseIdentifier: CellIdentifier];
}
return cell;
}
Run Code Online (Sandbox Code Playgroud) 如果可能,我想从我的UIScrollView禁用垂直滚动..我的代码如下所示.工作正常,除了用户可以上下滚动,这不应该在那里我相信..在此先感谢..
UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, self.view.frame.size.height / 3)];
scroll.contentSize = CGSizeMake(scroll.contentSize.width,scroll.frame.size.height);
scroll.pagingEnabled = YES;
scroll.backgroundColor = [UIColor blackColor];
int xVal = 30;
NSInteger numberOfViews = 5;
for (int i = 0; i < numberOfViews; i++) {
UILabel *testLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(xVal, 0, 90, 100)];
UILabel *testLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(xVal, 20, 90, 100)];
UILabel *testLabel3 = [[UILabel alloc] initWithFrame:CGRectMake(xVal, 40, 90, 100)];
testLabel2.backgroundColor = [UIColor clearColor];
testLabel2.text =@"Test1";
testLabel2.textColor = [UIColor whiteColor];
testLabel2.font = [UIFont …Run Code Online (Sandbox Code Playgroud) 在LevelHelper中,我能够将bezier形状设置为静态,动态等.在我的代码中,我需要更改这些属性.有人可以帮我吗?
LHBezier* bezier = [loader bezierWithUniqueName:@"BezierNode"];
[bezier makeStatic]; // not working
Run Code Online (Sandbox Code Playgroud) 我正面临更新我的标签的问题..它不会删除旧的值,所以新的值会在旧的值之上..任何有关此的帮助将不胜感激..
timer = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(updateLabels)
userInfo:nil
repeats:YES];
-(void) updateLabels{
for (GraphView *graph in arr){
// retrieve the graph values
valLabel = [[UILabel alloc] initWithFrame:CGRectMake(i * 200, 0, 90, 100)];
valLabel.textColor = [UIColor whiteColor];
valLabel.backgroundColor = [UIColor clearColor];
valLabel.text = [NSString stringWithFormat:@"Value: %f", x];
i++;
}
}
Run Code Online (Sandbox Code Playgroud) ios ×5
alignment ×1
ios5 ×1
ios6 ×1
label ×1
levelhelper ×1
objective-c ×1
uilabel ×1
uiscrollview ×1
uitableview ×1