Start developing Dashboard widgets, chapter 4, Reading Notes

Source: Internet
Author: User

Directory: http://blog.csdn.net/wide288/article/details/40298693

How to develop basic Widgets

How to Use HTML and CSS to get the widget shape
How to use JavaScript to get your widget


Starting with HTML
The project here is a weather map. The start point of each project is different, but the features of this widget must be listed first.
Feature list:
It should have a map radar that shows a region.
It should have the current temporary map.
It should have a temporary map of yesterday.
It should have a temporary map for tomorrow.


The map size can be adjusted.


Add background



Create CSS for the widget Structure
Body {
Margin: 0;
}
# Mapimage {
Position: absolute;
Top: 55px;
Left: 16px;
}
. Backgroundimage {
Position: absolute;
Top: 0px;
Left: 0px;
}


Reference Method
<Style type = "text/CSS">
@ Import export weathermaps.css ";
</Style>


Add menu


How it works
Write onclick Event Response in Js. Change the image reference content.


Create widget
Create info. plist


<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype plist public "-// Apple Computer // DTD plist 1.0 // en"
"Http://www.apple.com/dtds/propertylist-1.0.dtd">
<Plist version = "1.0">
<Dict>
<Key> allownetworkaccess </key>
<True/>
<Key> cfbundledisplayname </key>
<String> weathermaps </string>
<Key> cfbundleidentifier </key>
<String> com. Apple. widget. weathermaps </string>
<Key> cfbundlename </key>
<String> weathermaps </string>
<Key> cfbundleappsversionstring </key>
<String>. 04 </string>
<Key> cfbundleversion </key>
<String>. 04 </string>
<Key> closeboxinsetx </key>
<Integer> 12 </Integer>
<Key> closeboxinsety </key>
<Integer> 12 </Integer>
<Key> mainhtml </key>
<String> weathermaps.html </string>
</Dict>
</Plist>


Create a project icon
Icon.png


Change folder name
Double-click to install.
Make sure it works. Install and test it.

Start developing Dashboard widgets, chapter 4, Reading Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.