Remove UIWebView Shadow?

后端 未结 15 1194
慢半拍i
慢半拍i 2020-12-02 11:12

Does anyone know if its possible to remove the shadow that is placed on the UIWebView window?

Example: http://uploadingit.com/files/1173105_olub5/shadow.png

15条回答
  •  天命终不由人
    2020-12-02 11:54

    the small for loop is very dangerous because it can crash if apple changes the number of the subviews.

    this way it does at least not crash when something changes:

    if ([[webView subviews] count] > 0)
    {
        for (UIView* shadowView in [[[webView subviews] objectAtIndex:0] subviews])
        {
            [shadowView setHidden:YES];
        }
    
        // unhide the last view so it is visible again because it has the content
        [[[[[webView subviews] objectAtIndex:0] subviews] lastObject] setHidden:NO];
    }
    

提交回复
热议问题