Are there any visual differences between WKWebView and UIWebView? - xamarin

I wanted to migrate away from the deprecated UIWebView in Xamarin Forms iOS, and I read online that WKWebView is now the default in Xamarin Forms 4.x, and I was currently in 3.6.0.x.
So I decided to update hoping that the Webview would automatically update for me, but I realized there is no way to tell because I don't know what, and if there even is a difference in how the webviews look. I've looked online but can't find any side by side pictures of the same app/interface using WK vs. UI. Is there a difference at all?
The only difference I saw after updating, was that on one of the pages, the loading icon wouldn't disappear whereas it did after a couple of seconds in UI.
Thanks!

Welcome to StackOverflow! :)
The easiest way to answer this question is simply going to be to test it. To my knowledge, both UIWebView and WKWebView use the exact same underlying WebKit code/engine to render HTML content. There may be differences due to separate defaults and properties that one has vs. the other, but for the most part, they should be identical. But you shouldn't take my word for it! If you can, give it a try.

Related

Need advice on how to fix RBLPopover so that it will dynamically resize like NSPopover

RBLPopover is a Popover made by the Guys from Github that aims to mimimc NSPopover but fixes some of it's flaws, like canBecomeKeyWindow. It is part of the Rebel Framework they currently hosting on GitHub. I decided to use this Popover for my Statusbar Application and ran now into a problem. NSPopover is able to resize it's size dynamically and animated if it's shown and you use setContentSize. Then it will automatically resize animated to the newly given size. However, RBLPopover is not doing that. After 8 hours on looking into RBLPopover's Code I was not able to fix this, one reason will be lag of knowledge on my Part on how Views work internally in Detail.
The Code for RBLPopover can be found here:
https://github.com/github/Rebel/blob/master/Rebel/RBLPopover.m
Can someone give me a hint on how to fix this? I don't ask for code, just some advice/concept on how to achieve this. Is there some Method that is missing in it's parent class? I don't believe that showRelativeToRect:ofView:preferredEdge: is the right method to change. I believe that something more fundamental is missing but I don't get it.

Fluid swipe and scrolling 10.7 style

I'm looking to add two finger "fluid swiping" to my app. Anyone who has used the week view in the Calendar app that comes with OSX will have seen what I'm trying to do.
I have a scroll view, and I want to be able to use swipe gestures and scrolling to move the content view in the horizontal axis of my NSScrollView, ie a day or a week.
The video from WWDC 2011 titled "Scrolling, Swiping, Dragging: Now with more animation" was quite useful, and looks like it will be able to explain what I want to do, but unfortunately the sample code for PictureSwiper isn't provided with the video.
I'm aware that a newer version of PictureSwiper is avaliable, but it uses NSPageController and I'm really looking for the older Lion 10.7 way of handling things as I can't use NSPageController. Is it still possible to find the old PictureSwiper somewhere?
If not could someone explain how the PictureSwiper sample on Lion worked? I'm aware of the App note https://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKitOlderNotes.html (search for "scrollWheel:") but that has only gone part of the way to explaining the kind of functionality I am after.
Many thanks for any help.
David.
For anyone looking to this for an answer I eventually used one of my "Developer Technical Support" queries that came with my paid Dev account to ask for the old code. A few days latter an Apple engineer emailed me the old Picture Swiper.
Now that I have seen the code the App note makes complete sense! Picture Swiper moves CALayers around, but in my case I just use NSClipView's scrollToPoint:.
Within the scroll handler I just do something like: (gestureAmount * columnWidth) + currentColumnIndexOffset.
Seems to work!

Webkit page scaling in Cocoa

I'm making a WebKit-based text editor app for Mac, and I need to find a way to zoom the document in and out.
I've seen this StackOverflow article here, it suggests just scaling the view that Webkit is rendered into. The problem is, since Webkit doesn't know about it, this breaks things like drag & drop and causes Javascript to report the wrong cursor locations. Unfortunately, for some reason, the Cocoa WebKit API only supports scaling text up or down, not the whole page.
Safari and Chrome are both able to do this properly. I've gone as far as to look through the Chromium source code to figure out how it's done, but unfortunately it's using a completely different cross-platform API.
Any advice would be greatly appreciated. I'm not opposed to using private APIs, if I can figure out how to use them in a safe way.
-Keaton
The APIs for doing this aren't currently public, but they've been around for years and aren't likely to change. You can find them in WebKit's WebViewPrivate.h header. You won't find that header on your system, so you'll have to redeclare those methods yourself in a category. Something like:
#interface WebView (Zoom)
- (IBAction)zoomPageIn:(id)sender;
- (IBAction)zoomPageOut:(id)sender;
- (IBAction)resetPageZoom:(id)sender;
#end
Another option is just to set the CSS zoom property on the html element in your editor. You can do that in markup (<html style="zoom: 1.5">) or in JavaScript (document.documentElement.style.zoom = "1.5"). That doesn't require using any private APIs.

Phonegap basics - designing ui for iphone and android

I'm developing an application both for Iphone and Andriod using Phonegap.
I came up with all kinds of plugins JQuery, JQTouch and more,
What is the recommended way of doing this?
Meaning-designing a generic UI (tabbars, tables, navigation bars etc') for both Iphone,Android that will "feel" native?
Thanks,
Asaf
If you want your application to look as native as possible I'd try jQuery Mobile.
The documentation is brilliant and all of elements look native to the iPhone. It's also incredibly easy and quick to build up your UI as all of the design and colour scheme has already been done.
I've used this in an Android application that I've made and I've so far received very positive reviews.
You may also want to look out for Kendo UI which is out this month! Again, very similar to what jQuery mobile is about with a few exceptions. It has great support for graphs and data, and promotes native Android look and feel.
Sencha Touch has just released version 2 and it is a good JS toolkit as well.
I feel I have to put my hat in the ring for jQTouch. Although the version downloadable from their site is a bit oldish, if you get it from GitHub it is currently maintained and works well on both iOS and Android. https://github.com/senchalabs/jQTouch
Also, if you want the fixed headers or footers with scrollable elements in-between, DataZombie's fork of jQTouch includes iScroll which does a great job of this. https://github.com/DataZombies/jQTouch
I am also in the process of developing a theme for jQTouch that will allow apps on Android to feel quite a bit more "native" than the other js kits as they all seem to have a very iOS-cenrtic navigation style (e.g.: back buttons on toolbars instead of relying on the hardware back button, etc). Even if you don't want to wait for my theme, making your own is pretty easy on jQTouch. I would not call myself a designer and I managed. ;)
Feel free to choose one of the other answers, but keep jQTouch in mind. I tried and tried other JavaScript frameworks and it was the only one that made it possible to look good on both platforms.
jQuery Mobile works awesomely.. and with the theme roller coming soon it will be pretty good.
Kendo Mobile UI - Pre release rip.. I have a working Eclispe project here.. markup is identical to jQuery mobile.. but this is faster, nice native looking apps. Take a look

UI rendering issues with Segmented Control

I'm working on a simple app to learn Cocoa and I've encountered a little rendering bug with the segmented controller.
As you can see here, the view does not display fully opaque. I've looked around to try and find a solution to this to no avail. I did at one point think that maybe this control wasn't supposed to be used in this way but a quick browse through the system preferences yielded several views using this technique.
The control you are looking for is actually NSTabView. Docs here:
NSTabView

Resources