1. Trang chủ
  2. » Công Nghệ Thông Tin

500 pro iOS web design and development

486 119 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 486
Dung lượng 13,58 MB

Nội dung

www.it-ebooks.info For your convenience Apress has placed some of the front matter material after the index Please use the Bookmarks and Contents at a Glance links to access them www.it-ebooks.info Pro iOS Design and Development HTML5, CSS3, and JavaScript with Safari ■■■ Andrea Picchi i www.it-ebooks.info Pro iOS Web Design and Development: HTML5, CSS3, and JavaScript with Safari Copyright © 2011 by Andrea Picchi All rights reserved No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher ISBN-13 (pbk): 978-1-4302-3246-9 ISBN-13 (electronic): 978-1-4302-3247-6 Trademarked names, logos, and images may appear in this book Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights President and Publisher: Paul Manning Lead Editor: Steve Anglin Development Editor:Matthew Moodie Technical Reviewer: Daniel Paterson Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Morgan Engel, Jonathan Gennick, Jonathan Hassell, Robert Hutchinson, Michelle Lowman, James Markham, Matthew Moodie, Jeff Olson, Jeffrey Pepper, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Gwenan Spearing, Matt Wade, Tom Welsh Coordinating Editor: Adam Heath Copy Editor: Ginny Munroe Compositor: MacPS, LLC Indexer: BIM Indexing & Proofreading Servies Artist: SPi Global Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+Business Media, LLC., 233 Spring Street, 6th Floor, New York, NY 10013 Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com For information on translations, please e-mail rights@apress.com, or visit www.apress.com Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use eBook versions and licenses are also available for most titles For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales The information in this book is distributed on an “as is” basis, without warranty Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work The source code for this book is available to readers at www.apress.com You will need to answer questions pertaining to this book in order to successfully download the code www.it-ebooks.info To my parents, Gianni and Carla, for their endless support To my fiancée and “Mia Principessa,” Simona, source of strength, love, and will —Andrea Picchi www.it-ebooks.info Contents at a Glance Contents v About the Author xi About the Technical Reviewer xii Acknowledgments xiii Preface .xiv Introduction xxv ■Chapter 1: Think Mobile Touch 1 ■Chapter 2: Agile Project Building for iOS Devices 9 ■Chapter 3: Web Development for iOS Devices 51 ■Chapter 4: User Interface Design for iOS Devices 121 ■Chapter 5: iPhone UI Design: Think Simple 179 ■Chapter 6: iPad UI Design: Think Inverted 203 ■Chapter 7: Web Standards for WebKit: Maximizing Mobile Safari 243 ■Chapter 8: Native iOS Environment Development 319 ■Chapter 9: Native iOS Design Implementation 347 ■Chapter 10: Optimizing iOS WebApps 361 ■Chapter 11: Testing iOS WebApps 389 ■Chapter 12: Maximizing the Market for iOS WebApps 413 ■Chapter 13: Looking Beyond the Mobile Web to Ubiquitous Computing 427 Index 437 iv www.it-ebooks.info Contents Contents at a Glance iv About the Author xi About the Technical Reviewer xii Acknowledgments xiii Preface .xiv Introduction xxv ■Chapter 1: Think Mobile Touch 1 Why the Mobile Web? .1 From Desktop to Mobile .2 Mobile Market 4 Why Mobile Now? 5 A Mobile-Oriented Approach 6 Mobile-Oriented Guidelines .6 Apple’s Mobile Hardware 8 Summary 8 Agile Project Building for iOS Devices 9 Implementing a Mobile Information Architecture 9 What Is Information Architecture and Why Is It Important? .10 Abiding by the Golden Rules of Mobile Strategy 21 Content-Out Approach .22 Representing an Information Architecture with a Site Map .23 Sketching an Information Architecture with Wireframes 26 Visualizing Interactions Through Prototypes 28 Systematic Approach to Mobile Design 31 Accessibility in Apple Devices 32 Usability in iOS Devices 36 iPhone Page Model 40 iPhone User Interface .41 iPad Block Model .44 iPad User Interface 47 Tools for Apple Mobile Design 49 Summary 50 v www.it-ebooks.info ■ CONTENTS Web Development for iOS Devices 51 Web Development Tools .52 Development Frameworks .52 Mobile Web Site .60 Mobile Applications .60 Web Development Model 61 Web Development Model: Pros and Cons 62 Four Different Approaches to a WebApp 66 WebApp and Native App: What Makes the Difference for the User 69 Web Standards: HTML, CSS, and JavaScript 73 Browser Support for Standards: WebKit and Safari .106 SDK Development Model 115 Apple’s Objective-C, Cocoa Touch, and Xtools Model 115 Hi, I’m a Mac 118 Tools and Frameworks for Apple Mobile Development 119 Summary 120 User Interface Design for iOS Devices 121 User Interface Design 121 What Is an Interface? .123 Everything Is an Interface 125 Negative Space 130 Color Psychology 138 The Interface Hierarchy 147 Reading Patterns 148 The User Interface Design Process 157 iPhone and iPad Compatible User Interface Design 160 Research 161 Structure 164 Aesthetic 167 Interaction 168 Deliverables 170 iPad Native-Like User Interface Design 170 Research 170 Structure 171 Aesthetic 172 Interaction 173 Deliverables 173 iPhone Native-Like User Interface Design 173 Research 174 Structure 174 Aesthetic 176 Interaction 176 Deliverable .177 Tools for User Interface Design 177 Summary 178 iPhone UI Design: Think Simple 179 User Interface Sketching 179 vi www.it-ebooks.info ■ CONTENTS Think Simple .180 The iPhone is an On-the-Go Device .180 The Essence of the iPhone Page Model 180 iPhone Limitations 181 The Nature of Users’ Cognitive Resources 181 Anatomy of Sketching 181 Design Using Tools .184 Explore the Balsamiq Mockups Interface 185 Represent Connections 187 Designing with Adobe Fireworks 188 Creating a Canvas 189 Organize Levels 191 Layout Design 192 Interface Design .193 Reuse Design 198 Tools for User Interface Design 201 Summary 201 iPad UI Design: Think Inverted 203 User Interface Sketching 203 Think Inverted .204 Inverted Simplicity 205 Remove and Prioritize 206 Hide and Shape 207 Shrink and Group 209 Key Points of the Simplicity-Complexity Paradox 210 Sketching the UI .210 Design Using Tools .213 Design with Adobe Fireworks .219 iPad-Compatible Version .220 iPad Native-Like Version 233 Summary 242 Web Standards for WebKit: Maximizing Mobile Safari 243 Comparing iPhone and iPad for Web Presentation .244 HTML5 244 HTML5 Markup Syntax 244 HTML5 Re-Definitions 246 HTML5 Semantics 246 HTML5 Media 249 CSS3 272 Prefixes 273 Rounded Borders 274 Border Images .274 Gradients 275 Box Sizing 276 Box Shadow 277 Outline 278 Background Size 278 vii www.it-ebooks.info ■ CONTENTS Background Origin 279 Multiple Backgrounds 279 Text Shadow 280 Text Overflow 281 Word Wrapping 281 Web Fonts 282 Tap Highlight 282 Multiple Columns 283 Spanning Columns 284 Transitions .284 Transforms .285 Animation .286 Keyframes 289 Reflections .289 Javascript 290 Adding Javascript to a Webpage 292 Javascript Structure 293 Data Categories .293 Reserved Words .295 Variables 296 Operators .298 Conditional Statements 300 Loop Statements 302 Functions .303 Variable Scope .304 Arrays 305 Strings 307 Objects 308 BOM (Browser Object Model) 309 DOM (Document Object Model) 310 Compare DOM and HTML Structure .312 Working with DOM 314 Some Javascript Best Practices 316 Resource on Web Standards 317 Summary 318 Native iOS Environment Development 319 Setting up the Environment 319 Defining Viewport .321 Full-Screen Mode Application .323 Adding the Springboard Icon 324 Application Startup Image 325 Application Redirecting .326 Setting up the Head Section .327 Native Link Emulation 328 Native Text Emulation 328 Native Element Emulation 329 Native Scrolling Emulation 330 Native iOS Service Interaction 330 viii www.it-ebooks.info 442 Index link emulation, 328 scrolling emulation, 330 text emulation, 328–329 native interface, 348–359 Breadcrumb Bar, 352–353 footer section, 358–359 Hero Content area, 353–355 Menu Area, 356–358 Page Title element, 350–352 top bar section, 349–350 ergonomics, and usability, of mobile devices, ETA (Estimated Time Of Arrival), 406–407 evaluating tests, variables for, 405–411 evaluation techniques, 409–411 test feedback, 411 test variable, 410–411 expectation feedback, 408 experience design (XD) phase, 13–14 ■F F-shaped reading patterns, 151–152 Facebook, 416, 422–423, 425–426 fear of being misunderstood, 206 fear of failure, 206 fear of missing something, 206 feedback, 407–409 design, 407–408 emotional, 409 expectation, 408 finger-friendly development, 110–111 fonts, web, in CSS 3, 92 footers, 58–59, 358–359 Foundation framework, 116–117 frameworks Cocoa Touch, 116–118 Foundation framework, 116–117 UIKit framework, 117–118 expanding, 343–345 iWebKit, 353, 356–357 iWebKit framework, for iPhone, 54–59 linking framework elements, 54 UI elements, 54–59 linking elements of, 54 for mobile development, 119 UIKit, 117–118 from( ) method, 103, 290 fromCharCode( ) method, 308 full-screen mode, 323–324 function( ) method, 258–259, 261, 263, 265–266, 269, 271 functionalities, 416 functionName( ) method, 303 functions, Javascript, 303–304 ■G gesture events, 335, 337–339 gestures, touch events and, 334–343 design elements for, 340 native and customized handler for, 339 orientation change event, 340–342 paradigm, 334–339 getAttribute( ) method, 315 getContext( ) method, 256–257 getElementById( ) method, 314 getElementByTagName( ) method, 314 getElementsByName( ) method, 314 getElementsByTagName( ) method, 314 global cached resources, 364 Global Positioning System (GPS), global variables, in JavaScript language, 104 Google analytics, 387 Google Maps, 332–333 Google PageRank concept, algorithm, 383–385 GPS (Global Positioning System), gradient( ) method, 82, 102–103, 275–276, 290 gradients, in CSS 3, 82 Gradients property, CSS 3, 275 gray box design, Adobe Fireworks program, 233–237 gray, color psychology and user mood, 143 green, color psychology and user mood, 141 www.it-ebooks.info Index grouping elements, shrinking elements and, 209 guidelines, mobile-oriented, 6–7 GZIP compression, 369–371 ■H tag, 352 handlers, for touch events and gestures, 339 hardware, for mobile design, hasAttributes( ) method, 316 hasChildNodes( ) method, 316 HCI (human computer interaction), 15–16, 72–73 head sections, 327–328 tag, 348, 352–353, 355, 359, 362 header bars, 54–56 headers, and descriptions, 57 Heat Map test, 393–394 Hero Content area, 353–355 hiding elements, and shaping elements, 207–209 highlighting, tap, in CSS 3, 92 HTML structure, versus DOM structure, 312–313 HTML5 (Hypertext Markup Language 5), 244–272 < audio> tag, 251 tag, 252 tag, 249 Canvas attributes and methods, 254–256 basic shapes and lines, 256–262 canvas state (drawing state), 268–270 clipping paths, 266–267 complex shapes, 262–265 creating canvas slideshow, 270– 272 manipulating objects, 267 overview, 252–253 versus SVG, 253–254 definitions, 246 markup syntax, 244–246 new features of, 74–78 semantics, 246–247 SVG, 252–253 HTTP (Hypertext Transfer Protocol), reducing requests, 363–365 human computer interaction (HCI), 15–16, 72–73 Hypertext Markup Language See HTML5 Hypertext Transfer Protocol (HTTP), reducing requests, 363–365 ■I IA (information architecture) content-out approach, 22–23 mobile strategy, 21 phases of, 11–16 HCI, 15–16 ID, 14 IM, 12–13 IR, 12 IxD, 15 UE, 14–15 UX, 14 XD, 13–14 processes agile and optimized, 16–18 three main, 18–20 prototypes, 28–31 electronic, 30–31 paper, 30 representing with site map, 23–26 limiting user mistakes, 24–25 providing orientation with navigation path, 25–26 sketching with wireframes, 26–28 icons, springboard, 324–325 ID (interaction design) phase, 14–15 IDEs (Integrated Development Environment), Xcode, 115 IM (information management) phase, 12–13 image optimization, 366–369 avoiding scaling, 368–369 color depth, 366 www.it-ebooks.info 443 444 Index CSS sprites, 366–368 using CSS rules instead of, 368 images in reading patterns, 152–153 search engine oriented design, 385–386 startup, 325–326 incremental cycles, 389–390 indexOf( ) method, 306, 308 information architecture See IA Information Architecture Process, 10, 12, 16, 18, 50 information management (IM) phase, 12–13 information research (IR) phase, 12 insertBefore( ) method, 316 Integrated Development Environment (IDEs), Xcode, 115 interaction design (ID) phase, 14–15 interaction, with users, 159, 168–169, 173–177 interfaces definition of, 123–125 designing with Adobe Fireworks program, 198, 223–232 hierarchy of, 147–148 Internet, inverted simple approach, to UI design, 204–212 hiding and shaping elements, 207–209 removing and prioritizing elements, 206–207 shrinking and grouping elements, 209 simplicity-complexity paradox, 210 sketching UI, 210–212 iOS devices, 9, 36 iPad Adobe Fireworks program compatible with, 220–232 canvas, 220–221 interface design, 223–232 layout design, 222–223 organizing levels, 221–222 block model, 44–47 designing UIs compatible with, 160–170 aesthetic, 167–168 deliverables, 170 interaction, 168–169 research phase, 161–164 structure, 164–167 versus iPhone for web presentation, 244 iPhone/iPad simulator, 115 native-like design for, 170–173 Adobe Fireworks program, 233–242 aesthetic, 172–173 deliverables, 173 interaction, 173 research phase, 170 structure, 171–172 usability, 38 user interface, 47–49 Web optimization and compatibility, 361 iPhone designing UIs compatible with, 160–170 aesthetic, 167–168 deliverables, 170 interaction, 168–169 research phase, 161–164 structure, 164–167 development for using web standards, 118–119 versus iPad for web presentation, 244 native interface emulation, 348–359 Breadcrumb Bar, 352–353 footer section, 358–359 Hero Content area, 353–355 Menu Area, 356–358 Page Title element, 350–352 top bar section, 349–350 native-like design for, 173–177 aesthetic, 176 deliverable, 177 interaction, 176–177 research phase, 174 www.it-ebooks.info Index structure, 174–175 tools for UI design, 177 page model, 40–41, 50, 180, 347 usability, 38 user experience limitations of, 181 user interface, 41 using on the go, 180 viewport, 321 Web optimization and compatibility, 361 iPhone/iPad simulator, 115 IR (information research) phase, 12 isEqualNode( ) method, 316 isSameNode( ) method, 316 iterative cycles, 389–390 iterative-incremental lifecycle, 389–390 iWebKit framework, for iPhone, 54–59 linking framework elements, 54 UI elements, 54–59 iWebKit framework, 353, 356–357 ■J files, combining with CSS files, 365 functions, 303–304 loop statements, 302–303 objects, 308–309 operators, 298–300 reserved words, 295–296 search engine oriented design, 386 strings, 307–308 structure, 293 variable scope, 304–305 variables, 296–298 JavaScript file, 53, 272, 303 Javascript object, 307, 309 Javascript statement, 293, 296 join( ) method, 306 ■K keyframes, in CSS 3, 101–102, 289 ■L Javascript, 290–317 adding to webpage, 292 arrays, 305–307 best practices, 316–317 best practices for, 103–106 adding behaviors, 106 allowing maintenance and customization, 105 code, 104–106 DOM, 106 global variables, 104 mix technologies, 104 optimizing loops, 105 progressive enhancement, 105 shortcut notation, 105 testing elements, 106 BOM, 309–310 conditional statements, 300–302 data categories, 293–295 DOM versus HTML structure, 312–313 overview, 310–312 working with, 314–316 Landscape mode, 49 lastIndexOf( ) method, 308 Law of Closure, 129 Law of Common Fate, 129 Law of Continuity, 128 Law of Figure Ground, 129–131 Law of Past Experience, 130 Law of Proximity, 127–128 Law of Similarity, 128 layouts designing, with Adobe Fireworks program, 192, 222–223, 238–242 for touch-screen devices, 164–166 Lee, Stan, 154

Ngày đăng: 06/03/2019, 14:56