当前位置:网站首页>Uiscrollview add gestures show and hide keyboard
Uiscrollview add gestures show and hide keyboard
2022-06-24 02:30:00 【Juming 12255】
General idea : In itself textField Click the keyboard to pop up , After clicking the gesture, you view End edit , Gesture set to no, Click again textField The keyboard pops up , At this time, the notification gesture interaction is yes that will do
First, in the .h Add gesture protocol to the file <UIGestureRecognizerDelegate>
stay .m A gesture pointer is declared in the file
UITapGestureRecognizer * _gesture;
_gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hidesKeyboard)]; _gesture.enabled = NO;// The initial gesture is set to no [self.view addGestureRecognizer:_gesture]; Method of hiding keyboard
- (void)hidesKeyboard{ [self.view endEditing:YES]; _gesture.enabled = NO; }
The keyboard shows that I used notification and gesture to
Register a notice first ,
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow) name:UIKeyboardWillShowNotification object:nil]; The way to complete the notification is to set the gesture to yes that will do
- (void)keyboardWillShow { _gesture.enabled = YES;
}
边栏推荐
- How long can the trademark registration be completed? How to improve the speed of trademark registration?
- The United States offered 10million yuan to hunt down blackmail hackers and the energy industry became the "hardest hit" of phishing attacks | global network security hotspot
- What is vxlan? What are its advantages?
- Layout use case
- The cloud game is rendered by the server. How much broadband does the server need
- The dealer management and control platform in the leather industry simplifies the purchase approval process and easily controls agents
- Interesting talk about decorator mode, so you will never forget it
- What is a region name? Can a territory name be used for trademark registration?
- What information should be provided for enterprise trademark registration? Is it difficult to register a trademark?
- How to design and make ppt gradient effect?
猜你喜欢

Advanced BOM tool intelligent packaging function

How to fill in and register e-mail, and open mass mailing software for free

163 mailbox login portal display, enterprise mailbox computer version login portal

Leetcode969: pancake sorting (medium, dynamic programming)

2020 language and intelligent technology competition was launched, and Baidu provided the largest Chinese data set

Introduction to development model + test model

application. Yaml configuring multiple running environments

BIM model example
Cloudpods golang practice

If there are enumerations in the entity object, the conversion of enumerations can be carried out with @jsonvalue and @enumvalue annotations
随机推荐
An attempt to use Navicat tool to copy and export MySQL database data
Data backup is required for manual upgrade of WordPress website program
[security] Tencent public cloud released the revolutionary function of "driving threat operation" of the new SOC security operation center!
How to quickly handle third-party login and easy to expand?
Mysql Find_ IN_ Set function
Network engineers must know the 10 technical points of IPv6. It is recommended to collect them!
Tencent cloud temporary secret key scheme - character recognition example
How to obtain the information of easydss single / multiple live streams through the API interface?
Release of the first batch of bay area group standards! Tencent security takes the lead in developing trusted digital identity standards
How does [lightweight application server] build a cross-border e-commerce management environment?
What are the conditions for trademark registration? How long does it take to register a trademark?
What is the difference between trademark registration and company domain name? What is the difference between the two?
[tcapulusdb knowledge base] manually view the online operation of tcapulusdb
Cloud rendering: cloud exhibition hall of Tencent digital ecology Conference - open roaming mode on cloud
How to design cloud desktop server? What is the future of cloud desktop?
What is the large bandwidth of IDC machine room?
How to build your own cloud game server and what are the building steps
How to use annotations to record operation logs gracefully
Hungry? Remote dual live database practice
What is vxlan? What are its advantages?