0

こんにちは、私はダイアログのようにビュー290 * 280をカスタムします、すべては大丈夫です、しかし私のカスタムビューの後ろの他のビューはクリックできます、私は私のcustomViewがポップしたときに他のビューをクリックできます、私は私の後ろのウィンドウもしたいですカスタムビューはぼやけています。

私のコードは:

#import <UIKit/UIKit.h>

@interface RecordView :UIView


@property (strong, nonatomic) IBOutlet UIButton *confirmBu;
@property (strong, nonatomic) IBOutlet UIButton *playBu;
@property (strong, nonatomic) IBOutlet UIButton *recrodBu;
@property (strong, nonatomic) IBOutlet UIButton *closeBu;


@property (strong, nonatomic) IBOutlet UIImageView *backgroundImageview;
@property (strong, nonatomic) IBOutlet UIImageView *showImageview;

-(void)setViewStyle;
@end

 #import "RecordView.h"

    @interface RecordView ()

    @end

    @implementation RecordView

    @synthesize confirmBu;
    @synthesize playBu;
    @synthesize recrodBu;
    @synthesize closeBu;



    @synthesize backgroundImageview;
    @synthesize showImageview;



    -(void)setViewStyle{

         self.frame=CGRectMake(15,100, 290, 280);
         self.backgroundColor=[UIColor clearColor];

        backgroundImageview.layer.masksToBounds=YES;
        backgroundImageview.layer.cornerRadius=15.0;
        backgroundImageview.layer.borderWidth=4.0;
        backgroundImageview.layer.borderColor=[[UIColor lightGrayColor] CGColor];

    }

    @end

self.recordDialog= [[[NSBundle mainBundle] loadNibNamed:@"RecordView" owner:self options:nil]lastObject];
                [self.recordDialog setViewStyle];
  [delegate.window addSubview:self.recordDialog];
4

2 に答える 2

1

これを行う別の方法は、現在の画面のスクリーンショットをプログラムで作成することです。https://github.com/tomsoft1/StackBluriOSなどを使用してスクリーンショットをぼかし、その画像を背景として設定します。閉じるボタンをクリックすると、背景画像を再び非表示にするだけです。

于 2013-01-29T09:13:18.687 に答える
0

ぼかし効果のある半透明の画像を作成できます。最初の画像を表示してから、画像の上に290*280ビューを表示します。画像は背景コントロールをタップするのを防ぎ、ぼやけた外観になります。

于 2013-01-29T09:00:34.157 に答える