1

inputScreensユーザーがボタンを押して、現在別のボタンを開いている場所がいくつかありますpickerScreen with a picker and several buttons

pickerScreenを完全にカバーする完全な新しい画面として表示する代わりに、 を-の上に表示しinputScreensたいと思います。pickerScreeninputScreen

小さな画面が中央に表示され、グレー表示され、 が表示inputScreenされている限り、その下にあるものにアクセスできなくなりpickerScreenます。

現在inputScreenspickerScreenUIViewController で実装されています。...そして は をpickerScreen完全に置き換えますinputScreen

inputScreens の上に表示されるように pickerScreen を変更する簡単な方法はありますか?

どうもありがとう

4

1 に答える 1

4

必要なサイズのピッカー ビューを備えた UIView を作成し、ビューでそのビューを非表示にします。必要に応じてピッカービューのサイズ。

UIView *whiteCoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)];
    whiteCoverView.alpha = 0.9;
    whiteCoverView.tag = 999;
    whiteCoverView.backgroundColor = [UIColor grayColor];
    [self.view addSubview:whiteCoverView];




    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 25, 320, 40)];
    label2.backgroundColor = [UIColor clearColor];
    label2.numberOfLines = 0;
    label2.font = [UIFont boldSystemFontOfSize:15.0];
    label2.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
    label2.textAlignment = UITextAlignmentCenter;
    label2.textColor = [UIColor whiteColor];
    label2.text = @"cfff";
    [whiteCoverView addSubview:label2];
    [label2 release];

    int gap = 10;

    UILabel *label3a = [[UILabel alloc] initWithFrame:CGRectMake(20, gap+50, 280, 15)];
    label3a.backgroundColor = [UIColor clearColor];
    label3a.numberOfLines = 0;
    label3a.font = [UIFont boldSystemFontOfSize:13.0];
    label3a.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
    label3a.textAlignment = UITextAlignmentCenter;
    label3a.textColor = [UIColor whiteColor];
    label3a.text = @"cfccc ";
    [whiteCoverView addSubview:label3a];
    [label3a release];

このようにピッカーを追加します。`

于 2012-07-25T09:23:35.333 に答える