点击屏幕 任何 一处 产生事件

自定义导航栏 直接可以让美工去切一张图片  就可以了  不用写那么多代码       


//点击屏幕 任何一处 开始 下载   不要用//点击屏幕  任何 一处开始下载  中间加上 一个button  可以去 解决

//-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event   



中间加上 一个button  可以去 解决

  //点击事件响应   

        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

        button.backgroundColor = [UIColor clearColor];

        [button addTarget:self action:@selector(MagzineEvent:) forControlEvents:UIControlEventTouchUpInside];

        button.tag = kMagzineTag + i ;

        button.frame = CGRectMake(i * 320, 0, 320, ScreenWidth);

        [sv addSubview:button];


//label 自适应  宽度 与 高度

CGSize size;

    if (iOS7) {

        size = [str boundingRectWithSize:boundarySize options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObjectsAndKeys:font,NSFontAttributeName, nil] context:Nil].size;

    } else {

    

        size = [str sizeWithFont:font constrainedToSize:boundarySize lineBreakMode:LineBreakModeWordWrap];

    }


你可能感兴趣的:(点击屏幕 任何 一处 产生事件)