-1

Possible Duplicate:
Simulated low memory warning not working

So I have a UIViewController with a webview in it. I tried pushing another viewcontroller into the nav controller and then simulate a memory warning and then go back. Now the view with the webview is purely blank. I tried adding a view and changing the background color to this code and it didn't add it after the memory warning. I tried calling setNeedsLayout and setNeedsDisplay and it didn't help either. It's as if the view is not there. So I double checked the view frame and it is:

<UIView: 0x8aebd70; frame = (0 0; 768 960); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x8ae2830>>

any idea why?

4

2 に答える 2

0

それは正常です。iOS6 メモリ警告の前に、表示されないビュー コントローラーからルート ビューを削除します。iOS6 からは、ビュー コントローラーが所有する非表示ビューのバッキング ストアのみを削除します。したがって、すべては、webview に html ページをロードするように指示する場所によって異なります。のご利用をご提案いたします-viewWillAppear

于 2012-10-29T08:36:40.613 に答える
0

完全な HTML ページをダウンロードしてローカル キャッシュに保存し、webview にロードするように指示する必要があります。そのため、webview が mem 警告を受け取るたびに、メモリ内のコンテンツをアンロードし、戻ったときに HTML をキャッシュにロードします。

于 2012-10-28T19:47:07.727 に答える