小编Sus*_*rma的帖子

如何在键盘上方添加工具栏?

我已经以UIToolBar编程方式创建了一个并UITextField在其上添加了一个.现在,当我点击另一个文本字段时,我需要将该工具栏放在键盘上方.

UIToolbar *toolBar=[[UIToolbar alloc]initWithFrame:CGRectMake(0,400, 320, 60)];
[self.view addSubview:toolBar];

UITextField *txtView=[[UITextField alloc]initWithFrame:CGRectMake(0, 400, 260, 30)];
txtView.backgroundColor =[UIColor  grayColor];
txtView.placeholder=@"Address";
UIBarButtonItem *txtfieldItem=[[UIBarButtonItem alloc]initWithCustomView:txtView];
toolBar.items =[NSArray arrayWithObject:txtfieldItem];
Run Code Online (Sandbox Code Playgroud)

uitextfield uitoolbar ios

68
推荐指数
5
解决办法
5万
查看次数

如何创建应对弹出窗口?

我想创建相同的popUp,如图所示.这个popUp在iPhone中是默认的,但是如果我想用自己的消息进行自定义,我该如何创建呢?

这是图像. 你知道这在iPhone中是默认的. 但是如何在popUp中通过我自己的消息创建它

menu uitextfield ios

0
推荐指数
1
解决办法
82
查看次数

标签 统计

ios ×2

uitextfield ×2

menu ×1

uitoolbar ×1