Uistepper in Uialertview

Deadly 提交于 2019-12-23 05:23:31

问题


How can I show UIStepper in UIAlertView? Also suggest me any other alternative to show UIStepper in pop-up.


回答1:


A better way of inserting views in UIAlertView would be to add them as a subview

Try the following

UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:@"\n\n" delegate:nil  cancelButtonTitle:@"OK" otherButtonTitles: nil];
    UIStepper* stepper = [[UIStepper alloc] init];
    stepper.frame = CGRectMake(12.0, 5.0, 100, 10);
    [alert addSubview:stepper];
    [alert show];



回答2:


Try this.. Hope it will help you

 UIStepper *stepper = [[UIStepper alloc] initWithFrame:CGRectMake(120, 20, 0, 0)];

    UIAlertView *alert =[[UIAlertView alloc]init];// you can set your frame according to ypur requirment
    [alert addSubview:stepper];
    [alert show];


来源:https://stackoverflow.com/questions/14869020/uistepper-in-uialertview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!