Skip to Content
MOBILE WEB程式設計--第二版
book

MOBILE WEB程式設計--第二版

by Maximiliano Firtman
December 2013
Intermediate to advanced
752 pages
16h
Chinese
GoTop Information, Inc.
Content preview from MOBILE WEB程式設計--第二版
本機與需要安裝的 Web App
|
625
// 我們可以使用相同的處理程式與 ID
// 來分辨哪一個被按下
option1.onSelect = menuSelected;
option2.onSelect = menuSelected;
// 附加第一個選項
menu.Append(option1);
// 使用一個子選單來建立第三個選項
menu.Append(new MenuItem("Submenu", 4));
// 我們可以使用 ID 來搜尋 MenuItem
menu.getMenuItemById(4).Append(option2);
function menuSelected(id) {
switch (id) {
// 我們可以查詢 ID 來決定要做什麼
}
}
WRT 1.1 以後,widget 物件有一個
wrt
屬性可以用來查詢目前設備與
平台的資訊,包括
widget.wrt.version
widget.wrt.platform.model
widget.wrt.platform.romVersion
MiniView
MiniView 或主畫面 widget 也可以讓我們在設備的主畫面上顯示 widget 的內容(可不斷
更新),如圖 16-15 所示。在相容的設備上,widget 的安裝方式沒有什麼特別的地方,
但是如果
info.plist
檔裡面的
MiniViewEnabled
屬性被定義為
true
的話,使用者可以選擇
將它加到主畫面。
如果 widget 位於主畫面,它顯示的結果與全螢幕應用程式顯示的 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

成為卓越程式設計師的38項必修法則

成為卓越程式設計師的38項必修法則

Pete Goodliffe
精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly

Publisher Resources

ISBN: 9789862769522