Objective
Previously wrote the Hbuilder Development app primer-drop stone. I believe you should be able to get started after reading,
After that, you'll do some simple apps. Nativejs some of the functions that are used frequently, so it's not difficult to do apps later.
The Age of Knowledge
With the face++ interface, a face-recognition app was made, and Microsoft's accuracy was almost as real.
The main use of:
Native implementations of 1.actionsheet
2. Select a local photo
3. Use the camera to take pictures
4. Uploading Files using uploader
5. Call face++ interface for face recognition
6. Seven the implementation of the cow cloud upload
Actionsheet implementation
Actionsheet is not common on the iphone, the effect is seen in the top picture of the article,
MUI's Actionsheet are implemented in two ways. One or HTML5 imitation, one is to call the encapsulated Nativeui to implement,
As ever, it is better to recommend a native implementation. First, the effect is realistic, the second is less than the shortcomings.
Code:
Plus.nativeUI.actionSheet ({ title:title, cancel: ' Cancel ', buttons:btnarray }, Function (e) { if ( Func) func (e); });
To see, in fact, the Actionsheet method of invoking the Nativeui component, see: Here,
Above In fact, you just need to pass in a title, and a fixed cancel button. and the button array you need to pass in.
There is a callback function that infers e.index to determine which button was clicked,
Slightly encapsulated:
Actionsheetqiao.h.sheet = function (title, btns,func) { if (title && btns && btns.length > 0) {
var btnarray = []; for (var i=0; i<btns.length; i++) { Btnarray.push ({title:btns[i]}); Plus.nativeUI.actionSheet ({ title:title, cancel: ' Cancel ', buttons:btnarray }, Function (e) { if (func) func (e); });} ;
In this case.
The title is set to "select Photo", which requires two buttons, one is "photo", One is "album",
Code:
Qiao.h.sheet (' Select Photos ', [' Photo ', ' albums '], function (e) { var index = e.index; if (index = = 1) choicecamera (); if (index = = 2) choicepic (); });
When E.index=1, it was clicked on the first button "take a picture".
When the e.index=2. Click on the second button "albums".
When the e.index=0. Click Cancel, do not do the processing,
When you click somewhere else. E.index=-1, the same does not do the processing.
Many other tutorials:
Hbuilder Development App Combat 1-age: HTTP://UIKOO9.COM/BOOK/DETAIL/5
Many other study notes: Http://uikoo9.com/book
Hbuilder Development App Combat-age 01-actionsheet instance