uiwebview not resizing after changing orientation to landscape

后端 未结 2 1563
轮回少年
轮回少年 2020-12-16 02:48

I\'m coding an iPhone app in which I have a UIWebView that loads a website with a responsive design.

The problem I have is when I rotate the devices to

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-16 03:30

    finally, this solved my problem

    - (void)willAnimateRotationToInterfaceOrientation: (UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
       [self.myWebView setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    }
    

提交回复
热议问题