我想让我的操作表按钮中的文本的字体大小更小,因为我的文本比宽度长。
如何使字体变小?
我猜你可以将诸如选择器视图之类的东西添加到操作表中,我可能需要将我自己的按钮添加到操作表中,如果是这样的话怎么办?
我需要一个例子。
编辑:我已经取得了一些进展,但是没有显示实际的按钮,但是当您单击它时,您可以看到它与按钮文本的更改一起工作。
UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@"Date Picker"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"OK",nil];
CGRect frame = CGRectMake(100.0, 80.0, 100.0, 40.0);
UIButton *pickerView = [[UIButton alloc] initWithFrame:frame];
[pickerView setTitle:@"FRED" forState:UIControlStateNormal];
[pickerView setTitle:@"Go Back" forState:UIControlStateNormal];
[pickerView setTitleColor:[UIColor blackColor] forState:UIControlEventTouchDown];
pickerView.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
pickerView.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
//[removeButton addTarget:self action:@selector(buttonEvent:) forControlEvents:UIControlEventTouchDown];
[pickerView setBackgroundColor:[UIColor blueColor]];
[menu addSubview:pickerView];
[menu showInView:self.view];
[pickerView release];
[menu release];