开发者

how to create a button in uiview programmatically in iphone

开发者 https://www.devze.com 2023-02-06 21:23 出处:网络
In my iP开发者_Python百科hone application, how to add next and previous buttons in uiview programmatically?You can create dynamic buttons using the following code

In my iP开发者_Python百科hone application, how to add next and previous buttons in uiview programmatically?


You can create dynamic buttons using the following code

    UIButton *but=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    but.frame= CGRectMake(200, 15, 15, 15);
    [but setTitle:@"Ok" forState:UIControlStateNormal];
    [but addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:but];
0

精彩评论

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