Web浏览器不在Windows Phone 8上加载页面内容(Webbrowser not loading page content on Windows Phone 8)
我正在为某些网页构建一些缓存机制,因此如果网页已经存储在IsolatedStorage中,那么就不必在线获取它。 但是,当我加载页面时,内容(CSS,js,images)没有被加载,尽管文件已经在适当的路径中,文件中的路径看起来都是正确的。
当我尝试使用一个非常简单的html而只有一个图像时,内容被正确加载。
更复杂的网页有多个子目录,但内容的所有路径似乎都正确指向。
关于可能发生的事情的任何想法? 我已经尝试了几乎所有我在谷歌上找到的东西,没有成功。 这是WP8上Webbrowser控件的另一个错误问题,我不知道吗? 如果您有任何建议,我真的很感激。
先谢谢你!
I'm building somewhat of a caching mechanism for some webpages, so that if the webpage is already stored in IsolatedStorage, then it's not necessary to fetch it online. However, when I'm loading the page, the content (CSS, js, images) aren´t being loaded, although the files are already in the appropriate paths and the paths in the files all seem correct.
When I try using a very simple html with just an image in it, the content is loaded properly.
The more complex webpages have multiple sub-directories but all the paths to the content seem to be pointing correctly.
Any ideas on what may be happening? I've tried pretty much everything I've found on google, with no success. Is this just another buggy issue of the Webbrowser control on WP8 that I'm not aware of? I'd really appreciate if you have any suggestions.
Thank you in advance!
原文:https://stackoverflow.com/questions/30622435
最满意答案
我会注册UIPopover实例来收听一些通知。
[[NSNotificationCenter defaultCenter] addObserver:_myPopOver selector:@selector(myDismissPopover) name:@"dismissPopover" object:nil];
并为UIPopover类添加扩展。
- (void) myDismissPopover { [self dismissPopoverAnimated:YES]; }
当我需要解雇popover时,我只需要发布通知。
[[NSNotificationCenter defaultCenter] postNotificationName:@"dismissPopover" object:nil];
I'll write down my own solution as we've talked with bshirley in the comments of the question. I've implemented a mechanism like this to solve the problem:
In my login view controller, I create an NSMutableArray that will keep all my action sheets and popover controllers that are going to be dismissed. Then I store this array in a global dictionary. I access this dictionary via a utility method. Then all through the application, whoever creates an action sheet or a popover controller, adds the component to this array (retrieves the array from the global data, modifies it and then saves it back to the global data). Then when the user is thrown back to the login screen, in viewWillDisappear of my login view controller, I loop through this array and call the appropriate dismiss method by checking if the UIView I get from the array is an action sheet or a popover controller. Then I remove all the elements of this array and then store it back in the global data, again.
Hope this helps anyone who needs to implement a similar mechanism. Your comments will be appreciated.
相关问答
更多-
您的控制器层次结构如下所示: UITabViewController | | presents | UINavigationController | | contains view controllers | [root, MessagesViewController] 现在,如果你在MessagesViewController ,那么它的navigationController就是正在呈现的那个,这是你应该解雇的那个,但是在MessagesViewCont ...
-
为每个actionSheet设置一个标记,然后在UIActionSheet委托中使用switch语句。 分配标签 - (void)checkSolution { if (allCorrect) { UIActionSheet *levelCompleteActionSheet = [[UIActionSheet alloc] initWithTitle:@"Congratulations! You Have Finished the Level!" delegate:sel ...
-
在UIActionSheets上设置可访问性标签的首选方法是什么(What's the preferred way to set accessibility label on UIActionSheets)[2022-01-29]
从UIKit用户界面目录 : 默认情况下可以访问操作表。 操作表的可访问性主要涉及按钮标题。 如果激活了VoiceOver,则在显示操作表时会显示“alert”一词,如果设置则会说出其标题(尽管iOS人机界面指南建议不要使用标题操作表)。 当用户点击操作表中的按钮时,VoiceOver会说出其标题和单词“按钮”。 从您的问题来看,目前尚不清楚是否要将辅助功能标签更改为按钮标题+按钮以外的其他标签,但似乎无法以直接的方式进行。 From the UIKit User Interface Catalog: Ac ... -
最后通过在moviePlayerPlayBackDidFinish添加其他代码解决了我的问题: self.navigationController?.popViewControllerAnimated(true) 经过大量研究,我从这里找到了解决方案: dismissViewControllerAnimated()不会解除视图控制器 Finally solved my issue by adding the additional code in moviePlayerPlayBackDidFinish: ...
-
我会注册UIPopover实例来收听一些通知。 [[NSNotificationCenter defaultCenter] addObserver:_myPopOver selector:@selector(myDismissPopover) name:@"dismissPopover" ...
-
我能够模拟我想要的效果(在IB中)将Red的演示风格设置为“当前上下文”。 这告诉UIKit保持Red的父母的(白色)视图,所以如果例如Red在其视图中具有透明度,White将显示出来。 在解雇过程中,我将Red设置为完全透明,并将蓝色设置为动画。 @IBAction func didTapDismissBoth(sender: AnyObject) { let red = presentingViewController! let white = red.presentingViewCon ...
-
如何正确呈现两个连续的UIPopoverControllers?(How to present two consecutive UIPopoverControllers properly?)[2022-08-22]
发生的事情如下: 当显示弹出窗口时,其外部的每个点击将简单地使弹出窗口被解除,并且不会被转发到其他视图; 你可以使用passthroughViews来覆盖这个机制, passthroughViews是一个视图列表,可以获取转发给它们的点击; 必须注意的是,当转发发生时(即,你点击passthroughViews一个视图),弹出窗口不会自动被解除; 所以,在你的情况下,你将不得不自己解雇,当点击按钮时,你将打开第二个弹出窗口。 来自Apple文档 : 显示时,弹出窗口外部的水龙头会自动解除弹出窗口。 要允许用 ... -
解雇当前呈现并在应用简历上显示特定的ViewController(dismiss currently presented and show specific ViewController on app resume)[2023-04-14]
您可以使用AppDelegate方法: 更新 - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was //inactive. If the application was previously in the background, optionall ... -
您可以找到顶部呈现的视图控制器并检查它是否是UIAlertController 。 如果是,那么你可以调用dismissViewControllerAnimated:就可以了。 所有这一切都可以通过app委托完成。 You could find the top presented view controller and check to see if it's a UIAlertController. If it is, then you could call dismissViewControllerAn ...
-
[self dismissViewControllerAnimated:YES completion:nil] (在iOS 5之前[self dismissModalViewControllerAnimated:YES] )可以实现相同的行为,因为一次最多只有一个视图控制器呈现(模态)。 但是,委托模式的要点是单个视图控制器可以以不同的方式呈现,例如模态或通过推送到导航堆栈。 该视图控制器不知道它是如何呈现的(好吧,它可以解决它,但它不应该关心)。 它应该做的唯一事情是通知它的父母,即代表,它的工作已经完成 ...