苹果手机视频工具箱怎么调出来

苹果手机视频工具箱怎么调出来,第1张

打开快速搜索框,然后输入工具箱,然后就可以调出来。

在屏幕上点击一下可以看到快捷键的,如果要工具栏的话把鼠标移到最上方,然后点击左上角的绿色键,取消最大化。

1.

打开手机,点击“设置”,选择“控制中心”,在“控制中心”中点击“自定控制”。

2.

在“自定控制”中点击“加号”,选择想要设置到下拉菜单中的工具,进行添加。

3.

添加完后上拉“控制中心”,唤起下拉菜单可看到已设置添加的工具。

4.

如果要去掉相应的工具,在“自定控制”中点击“减号”即可

大致思路是提前创建好工具栏,在键盘d出的时候将工具栏显示出来,在键盘消失的时候让工具栏隐藏

上代码

设置两个变量

12

uiview * _toolview//工具栏uitextfield *textfield// 输入框 呼出键盘用

创建工具栏 输入框 添加键盘d出 消失的通知

1234567891011121314151617181920212223242526272829303132333435363738394041424344

- (void)viewdidload { [super viewdidload]// do any additional setup after loading the view, typically from a nib. textfield = [[uitextfield alloc]initwithframe:cgrectmake(10, 64, 120, 60)]textfield.placeholder = @"测试"[self.view addsubview:textfield]//增加监听,当键盘出现或改变时收出消息 [[nsnotificationcenter defaultcenter] addobserver:selfselector:@selector(keyboardwillshow:) name:uikeyboardwillshownotificationobject:nil]//增加监听,当键退出时收出消息 [[nsnotificationcenter defaultcenter] addobserver:selfselector:@selector(keyboardwillhide:) name:uikeyboardwillhidenotification object:nil]//初始化工具栏 _toolview = [[uiview alloc]init]_toolview.frame = cgrectmake(0, screen_height, screen_width, 50)[self.view addsubview:_toolview]uibutton *losebtn = [uibutton buttonwithtype:uibuttontypecustom]losebtn.frame = cgrectmake(20, 0, 50, 50)[losebtn addtarget:self action:@selector(btnclick) forcontrolevents:uicontroleventtouchupinside][losebtn settitlecolor:[uicolor blackcolor] forstate:uicontrolstatenormal][losebtn settitle:@"收起" forstate:uicontrolstatenormal][_toolview addsubview:losebtn]uibutton *imagebtn = [uibutton buttonwithtype:uibuttontypecustom][imagebtn settitle:@"图片" forstate:uicontrolstatenormal]imagebtn.frame = cgrectmake(screen_width-100, 0, 50, 50)[imagebtn settitlecolor:[uicolor blackcolor] forstate:uicontrolstatenormal][imagebtn addtarget:self action:@selector(imagebtnclick) forcontrolevents:uicontroleventtouchupinside][_toolview addsubview:imagebtn]uibutton *camerabtn = [uibutton buttonwithtype:uibuttontypecustom][camerabtn settitle:@"相机" forstate:uicontrolstatenormal]camerabtn.frame = cgrectmake(screen_width-50, 0, 50, 50)[camerabtn settitlecolor:[uicolor blackcolor] forstate:uicontrolstatenormal][camerabtn addtarget:self action:@selector(camerabtnclick) forcontrolevents:uicontroleventtouchupinside][_toolview addsubview:camerabtn]uibutton *canclebtn = [uibutton buttonwithtype:uibuttontypecustom][canclebtn settitle:@"取消" forstate:uicontrolstatenormal]canclebtn.frame = cgrectmake(screen_width-150, 0, 50, 50)[canclebtn settitlecolor:[uicolor blackcolor] forstate:uicontrolstatenormal][canclebtn addtarget:self action:@selector(canclebtnbtnclick) forcontrolevents:uicontroleventtouchupinside][_toolview addsubview:canclebtn]}

实现键盘通知的方法

12345678910111213141516171819202122

#pragma mark 当键盘出现或改变时调用- (void)keyboardwillshow:(nsnotification *)anotification{ //键盘d出时显示工具栏 //获取键盘的高度 nsdictionary *userinfo = [anotification userinfo]nsvalue *avalue = [userinfo objectforkey:uikeyboardframeenduserinfokey]cgrect keyboardrect = [avalue cgrectvalue]float keyboardheight = keyboardrect.size.height// nslog(@"%ld",(long)keyboardheight)[uiview animatewithduration:0.1 animations:^{ _toolview.frame = cgrectmake(0, screen_height-keyboardheight-50, screen_width, 50)}]}#pragma mark 当键退出时调用- (void)keyboardwillhide:(nsnotification *)anotification{ //键盘消失时 隐藏工具栏 [uiview animatewithduration:0.1 animations:^{ _toolview.frame = cgrectmake(0, screen_height+50, screen_width, 50)}]}

给工具栏上的各个按钮实现点击事件

123456789

- (void)btnclick{ [textfield resignfirstresponder]}- (void)imagebtnclick{}- (void)camerabtnclick{}- (void)canclebtnbtnclick{}

ps:下面看下ios 键盘上方增加工具栏的代码。

具体代码如下所示:

1234567

uitoolbar *keyboarddonebuttonview = [[uitoolbar alloc] init][keyboarddonebuttonview sizetofit]uibarbuttonitem *donebutton = [[uibarbuttonitem alloc] initwithtitle:@"done"style:uibarbuttonitemstylebordered target:selfaction:@selector(doneclicked:)][keyboarddonebuttonview setitems:[nsarray arraywithobjects:donebutton, nil]]txtfield.inputaccessoryview = keyboarddonebuttonview


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/tougao/6087346.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-03-14
下一篇2023-03-14

发表评论

登录后才能评论

评论列表(0条)

    保存