What's the big deal about native UI?
Yet with HTML, you can still leverage your web skills, code, and familiar frameworks like Ionic, Bootstrap, and Ember.
Docked | ||
Overlays | ||
Fullscreen | ||
Widgets () |
Floating () |
Use simple classes like Button, Grid, or DatePicker. The UI framework provides cross-platform abstractions for native controls, layout, styling, and more. These abstractions are easy to use in JavaScript, TypeScript, or XAML markup.
Or, you can use platform-specific native controls directly. You've got many options:
Cross-Platform (Write Once) |
Platform-Specific (Write Twice) |
|
---|---|---|
JavaScript |
var button = new ace.Button(); |
var button; if (ace.platform == "iOS") button = new ace.NativeObject("UIButton"); else if (ace.platform == "Android") button = new ace.NativeObject("android.widget.Button"); |
XAML |
<Button />
|
<if:iOS> <ios:UIButton /> </if:iOS> <if:Android> <android:Button /> </if:Android> |
Android XML | only |
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" /> |
Interface Builder (NIB/XIB) |
only |
Cross-Platform (Write Once) |
|
---|---|
JavaScript |
var button = new ace.Button(); |
XAML |
<Button />
|
Platform-Specific (Write Twice) |
|
JavaScript |
var button; if (ace.platform == "iOS") button = new ace.NativeObject( "UIButton"); else if (ace.platform == "Android") button = new ace.NativeObject( "android.widget.Button"); |
XAML |
<if:iOS> <ios:UIButton /> </if:iOS> <if:Android> <android:Button /> </if:Android> |
Android XML |
<Button android:layout_width= "wrap_content" android:layout_height= "wrap_content" /> |
Interface Builder (NIB/XIB) |
If you decide to use markup, you can link to it directly from your HTML, regardless of its type:
<a href="native://page.xaml"> Go to an all-native page </a> <a href="android://page.xml"> Go to an Android XML page </a> <a href="ios://page.xib"> Go to an Interface Builder page </a>
Invoke anything from JavaScript. Your own code, third-party code, or platform APIs. No additional plugins or wrappers needed.
Directly add Java, Objective-C, and Android resources to your Cordova project so you can easily leverage them.