开发者

Setting property of a subview

开发者 https://www.devze.com 2023-04-03 08:29 出处:网络
I have a UIView containing among others a subview. -(void) viewDidLoad { geopointView = [[UIView alloc] initWithFrame:CGRectMake(0, 350, 100, 80)] ;

I have a UIView containing among others a subview.

-(void) viewDidLoad
{
    geopointView = [[UIView alloc] initWithFrame:CGRectMake(0, 350, 100, 80)] ;
    UIButton *SaveButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain] ;
    SaveButton.frame = CGRectMake(0, 40, 100, 40) ;
   开发者_JAVA百科 [geopointView addSubview:SaveButton];
}

I want to set userInteractionEnabled property of this subview in another method.

How can I dot it? thanks for any help in advance.


declare the savebutton in the header file. You have declared it as a local member.Have it declared as a global variable.

0

精彩评论

暂无评论...
验证码 换一张
取 消