Mbprogresshud override keyboard

Source: Internet
Author: User

When sending a Weibo message, you need to use mbprogresshud to overwrite the window and wait for the message to be sent successfully. However, the keyboard cannot overwrite the window.

So all kinds of research, add to view, add to window, all have no results .. I think that I can't cover all windows. This is really amazing.

Then I suddenly checked the count of the window and found that there were two windows !!! I think the iPhone should have only one window .. But I vaguely remember who said that the iPhone sometimes has multiple windows.

Finally, the HUD is added to the second window, And the overwrite is successful.

After traversing the views of the second window, we found that there was a keyboard in it, and it was very clear.

Originally, the second window was used to hold the keyboard. You can add the HUD to the window where the keyboard is located to overwrite the keyboard.

PseudoCodeAs follows:

Uiwindow* Win = [[UiapplicationSharedapplication].WindowsObjectatindex:1];

Mbprogresshud* Hub = [[MbprogresshudAlloc]Initwithwindow: Win];

Hub.Mode=Mbprogresshudmodeindeterminate;

Hub.Labeltext=@"Sending...";

[WinAddsubview: Hub];

[HubShow:Yes];

[HubHide:Yes Afterdelay:3];

[HubRelease];

The result of traversing views is as follows:

18:05:53. 453 huddemo [3736: f803] view0 is <bandwidth: 0x689f550; frame = (0 228; 320 252); autoresizessubviews = no; layer = <uiperipheralhostlayer: 0x68a93b0>

18:05:53. 455 huddemo [3736: f803] view1 is <uikeyboardcornerview: 0x68aa1f0; frame = (0 473; 7 7); opaque = no; userinteractionenabled = no; layer = <calayer: 0x68aa230>

18:05:53. 455 huddemo [3736: f803] view2 is <uikeyboardcornerview: 0x68aa3a0; frame = (313 473; 7 7); opaque = no; userinteractionenabled = no; layer = <calayer: 0x68aa3e0>

18:05:53. 455 huddemo [3736: f803] view3 is <mbprogresshud: 0x6ab27a0; frame = (0 0; 320 480); alpha = 0; opaque = no; autoresize = Lm + RM + TM + bm; layer = <calayer: 0x6abd860>

 

I also hope that the experts will give me some advice on how iOS will have multiple windows...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.