[英]QuickDialog doesn't show 'prev' and 'next' toolbar as it's inputaccessoryview
[英]View doesn't scroll to selected element QuickDialog
我正在嘗試實現基本的QuickDialog視圖,並且元素的放置效果很好。 但是,當我選擇一個元素時,視圖不會將其滾動到視圖中。 我以為圖書館會自己做到這一點,還是我錯過了什么?
這是我的代碼:
- (id)initWithCoder:(NSCoder *)aDecoder {
if ((self = [super initWithCoder:aDecoder])) {
QRootElement *root = [[QRootElement alloc] init];
root.title = @"";
root.grouped = YES;
self.root = root;
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
QSection *driverSection = [[QSection alloc] initWithTitle:@"xxx"];
QEntryElement *lblDriverSsn = [[QEntryElement alloc] initWithTitle:@"xxx" Value:@""];
lblDriverSsn.key = @"driverSsn";
QSection *vehicleSection = [[QSection alloc] initWithTitle:@"xxx"];
NSArray *component1 = @[@"xxx", @"xxx"];
QPickerElement *EventDescriptionPicker = [[QPickerElement alloc] initWithTitle:@"xxx" items:@[component1] value:@""];
EventDescriptionPicker.key = @"eventDescription";
NSMutableArray *speedValues = [[NSMutableArray alloc]init];
for (int i = 0; i <= 201; i+=5)
{
[speedValues addObject:[NSString stringWithFormat:@"%d%@", i,@" km/h"]];
}
QPickerElement *vehicleSpeed = [[QPickerElement alloc] initWithTitle:@"xxx" items:@[speedValues] value:@""];
self.damageReported = [[QBooleanElement alloc] initWithTitle:@"xxx" BoolValue:NO];
self.damageReported.onImage = [UIImage imageNamed:@"imgOn"];
self.damageReported.offImage = [UIImage imageNamed:@"imgOff"];
self.damageReported.controllerAction = @"showReportNumber:";
QEntryElement *lblReportNumber = [[QEntryElement alloc] initWithTitle:@"xxx" Value:@""];
lblDriverSsn.key = @"reportNumber";
//Sections
[driverSection addElement:lblDriverSsn];
[self.root addSection:driverSection];
[vehicleSection addElement:EventDescriptionPicker];
[vehicleSection addElement:vehicleSpeed];
[vehicleSection addElement:self.damageReported];
[vehicleSection addElement:lblReportNumber];
[self.root addSection:vehicleSection];
}
我在這里想念什么嗎? 提前致謝
在您的initWithCoder:上,設置以下內容:
self.resizeWhenKeyboardPresented =YES;
這將導致視圖控制器偵聽鍵盤通知,並相應地調整插圖。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.