Is there a library or framework for setting preferences from within an iPhone application?

前端 未结 5 892
Happy的楠姐
Happy的楠姐 2021-02-10 05:20

Using the Settings.app on the iPhone isn\'t that hard. In fact Xcode does the most of the work for you. Just add the Settings.bundle to your project and there you have it for ne

5条回答
  •  后悔当初
    2021-02-10 05:37

    Well if you are doing settings then I would suggest putting them in the correct place and using the Settings.bundle.

    I guess you are doing settings though that are highly important to you app and it would be a horrible user experience if they had to keep jumping from the app to settings and back again.

    When you say doing the task is heavy - can you elaborate - as I have done it and it has not been heavy.

    Use a UITableViewController

    for each cell that you want to use put in code similar to:

            cell.textLabel.text = @"Last name:";
            UIFont *labelFont = [UIFont systemFontOfSize:[UIFont labelFontSize]];
            CGSize textSize = [cell.textLabel.text sizeWithFont:labelFont];
            baseRect.origin.x = textSize.width+15;
            baseRect.origin.y +=7;
            baseRect.size.width = baseRect.size.width - textSize.width - 15;
            baseRect.size.height = 23;
            UITextField *textField = [[UITextField alloc] initWithFrame:baseRect];
            textField.keyboardType = UIKeyboardTypeAlphabet;
            textField.returnKeyType = UIReturnKeyDone;
            textField.clearButtonMode = UITextFieldViewModeWhileEditing;
            textField.delegate = self;
            textField.placeholder = @"last name";
            [textField addTarget:self action:@selector(lastNameChanged:) forControlEvents:UIControlEventAllEditingEvents];
            textField.tag = 182;
            [cell.contentView addSubview:textField];    
            [textField release];
    

    This has worked for me to reproduce the interface you are talking about - the example here is a TextField - but the same code has worked very well with all controls.

提交回复
热议问题