SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
User Interface




Eng. Abdulrazzaq Alnajjar     iabdulrazzaq@outlook.com   1
A Screen Full of Controls
• What to learn:
       – Image view
       – Text field
       – Slider
       – Segmented control
       – Switch
       – action sheet
       – Alert

Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   2
Controls
• Active
• Static
• Passive
       – most of the available controls can be used in all
         three modes.
       – All iOS controls are subclasses of UIControl.




Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com         3
Differences of Controls on iOS
• Because of the multitouch interface, all iOS
  controls can trigger multiple actions depending
  on how they are touched.
• You could have one action fire when the user
  presses down on a button and a separate action
  fire when the finger is lifted off the button.
• You could have a single control call multiple
  action methods on a single event.
• iOS devices do not have a physical keyboard.
Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   4
Image View
• Drag an image view onto the view in the nib
  editor.




Eng. Abdulrazzaq Alnajjar    iabdulrazzaq@outlook.com   5
Image View
• Resizing the Image View
       – resize the image view to match the size of its
         contents. select Editor ➤ Size to Fit Content.
• Alignment
       – Editor ➤ Align ➤ Horizontal/Vertical Center in
         Container
• Draw a outline
       – Editor ➤ Canvas ➤ Show Bounds Rectangles

Eng. Abdulrazzaq Alnajjar    iabdulrazzaq@outlook.com     6
Image View Attributes
• Attributes
       – The Mode Attribute
       – Tag
       – Interaction Checkboxes
       – The Alpha Value
       – Background
       – Drawing Checkboxes
       – Stretching

Eng. Abdulrazzaq Alnajjar      iabdulrazzaq@outlook.com   7
Image View Attributes
1) The Mode menu defines how the view will
   display its content.
       – choosing any option that causes the image to
         scale will potentially add processing overhead, so
         it’s best to avoid those and size images correctly
         before importing them.




Eng. Abdulrazzaq Alnajjar      iabdulrazzaq@outlook.com       8
Image View Attributes
2) Tags provide an easy, language-independent
   way of identifying objects on your interface.
3) Interaction Checkboxes:
       – User Interaction Enabled: specifies whether the
         user can do anything at all with this object
       – Multiple Touch: determines whether this control is
         capable of receiving multitouch events.



Eng. Abdulrazzaq Alnajjar      iabdulrazzaq@outlook.com       9
Image View Attributes
4) Alpha defines how transparent your image
   is—how much of what’s beneath it shows
   through.
       – It’s defined as a floating-point number between
         0.0 and 1.0, where 0.0 is fully transparent and 1.0
         is completely opaque.
5) Background determines the color of the
   background for the view.

Eng. Abdulrazzaq Alnajjar      iabdulrazzaq@outlook.com    10
Image View Attributes
6) Drawing Checkboxes:
       – Opaque: tells iOS that nothing behind this view
         ever needs to be drawn no matter what.
       – Hidden: hides an object.
       – Clears Graphics Context: draws the entire area
         covered by the object in transparent black before
         it actually draws the object.



Eng. Abdulrazzaq Alnajjar      iabdulrazzaq@outlook.com      11
Image View Attributes
6) Drawing Checkboxes(cont.):
   – Clip Subviews: If checked, only the portions of
     subviews that lie within the bounds of the parent
     will be drawn. If unchecked, subviews will be
     drawn completely, even if they lie outside the
     bounds of the parent.
   – Autoresize Subviews tells iOS to resize any
     subviews if this view is resized.



Eng. Abdulrazzaq Alnajjar      iabdulrazzaq@outlook.com   12
Image View Attributes
7) Stretching
       – The four floating-point values set here let you
         declare which portion of the rectangle is
         stretchable by specifying a point at the upper-left
         corner of the view and the size of the stretchable
         area, all in the form of a number between 0.0 and
         1.0, representing a portion of the overall view size




Eng. Abdulrazzaq Alnajjar      iabdulrazzaq@outlook.com     13
Text Fields
• Grab 2 text fields & 2 labels from the library into
  the View.




Eng. Abdulrazzaq Alnajjar    iabdulrazzaq@outlook.com   14
Text Field Inspector Settings




Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   15
Text Field Inspector Settings
• Text
• Placeholder
• font
• font color
• Background and Disabled.
• Border Style
• Clear Button & Clear when editing begins
  checkbox
• Adjust to Fit checkbox
Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   16
Text Field Inspector Settings
• Keyboard:
       – Capitalization
       – Correction
       – Keyboard
       – Appearance
       – Return Key
       – Auto-enable Return Key checkbox
       – Secure checkbox
• Control: Enabled checkbox
Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   17
Creating and Connecting Outlets
• s




Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   18
Closing the Keyboard
• In header file:




Eng. Abdulrazzaq Alnajjar         iabdulrazzaq@outlook.com   19
Closing the Keyboard
• In implementation file(before @end):




• From connections inspector Drag from the
  circle next to Did End On Exit to the
  textFieldDoneEditing: method.


Eng. Abdulrazzaq Alnajjar         iabdulrazzaq@outlook.com   20
Touching the Background to Close the
                Keyboard
• In header file:




Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   21
Touching the Background to Close the
                Keyboard
• In implementation file(before @end):




• Go to identity inspector: change class into
  UIControl
• Connect the view’s Touch Down event to the
  backgroundTap: action

Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   22
Slider
• A slider lets you choose a number in a given
  range.
• Minimum, Maximum and Current values.




Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   23
Slider Actions and Outlets
• Slider Action: Set the Type to UISlider.
• Label outlet.
• Slider Action method:



• Set current value:



Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   24
Segmented Control & Switches
• Segmented Control used to
  show & hide objects.
• Switches are small controls
  that can have only two states:
  on and off.




Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   25
Segmented Control & Switches
• Add a segmented control & 2 switches.
• Create Outlets (rightSwitch, leftSwitch)and
  one action(switchChanged) for the two
  switches.
       – set the Type of its sender to UISwitch.
• Create an action(toggleControls) for the
  segmented control.
       – set the Type of its sender to UISegmentedControl.

Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com         26
Segmented Control & Switches
• Switch Actions:




Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   27
Segmented Control & Switches
• Add a button directly on top
  of the two switches.
       – create an outlet
         (doSomethingButton) & an
         action (buttonPressed).
• Check the buttons Hidden
  checkbox.



Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   28
Segmented Control & Switches
• segmented control action:




Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   29
Action Sheet and Alert
• Action sheets are used to force the user to
  make a choice between two or more items.
• Alerts force users to respond before they are
  allowed to continue using the application




Eng. Abdulrazzaq Alnajjar     iabdulrazzaq@outlook.com   30
Action Sheet and Alert
• Action sheet action:




       – Then add a method after the buttonPressed: method

Eng. Abdulrazzaq Alnajjar     iabdulrazzaq@outlook.com       31
Eng. Abdulrazzaq Alnajjar   iabdulrazzaq@outlook.com   32
viewDidLoad Method
• viewDidLoad helps to modify any of the
  objects that were created in nib file.




Eng. Abdulrazzaq Alnajjar        iabdulrazzaq@outlook.com   33
viewDidLoad Method




Eng. Abdulrazzaq Alnajjar        iabdulrazzaq@outlook.com   34
viewDidLoad Method
• The former code sets the background image
  for the button.
• It specifies that, while being touched, the
  button should change from using the white
  image to the blue image. This short method
  introduces two new concepts: control states
  and stretchable images.


Eng. Abdulrazzaq Alnajjar        iabdulrazzaq@outlook.com   35
Control States
• Every iOS control has four possible control states:
       – Normal: is the default state. It’s the state that controls are
         in when not in any of the other states.
       – Highlighted: is the state a control is in when it’s currently
         being used.
       – Disabled: when they have been turned off, which can be
         done by unchecking the Enabled checkbox in Interface
         Builder or setting the control’s enabled property to NO.
       – Selected: It is usually used to indicate that the control is
         turned on or selected. Selected is similar to highlighted,
         but a control can continue to be selected when the user is
         no longer directly using that control.

Eng. Abdulrazzaq Alnajjar      iabdulrazzaq@outlook.com               36
Stretchable Images
• A stretchable image is a resizable image that
  knows how to resize itself intelligently so that
  it maintains the correct appearance.
       – Edge insets are the parts of an image, measured
         in pixels, that should not be resized.




Eng. Abdulrazzaq Alnajjar        iabdulrazzaq@outlook.com   37

Weitere ähnliche Inhalte

Andere mochten auch

Beginning iOS6 Development CH03 Handlling Basic Interaction
Beginning iOS6 Development CH03 Handlling Basic InteractionBeginning iOS6 Development CH03 Handlling Basic Interaction
Beginning iOS6 Development CH03 Handlling Basic InteractionAbdulrazzaq Alnajjar
 
Swimming pools lesson 1
Swimming pools lesson 1Swimming pools lesson 1
Swimming pools lesson 1James Buchanan
 
Beginning iOS6 Development CH06 Multiview Applications
Beginning iOS6 Development CH06 Multiview ApplicationsBeginning iOS6 Development CH06 Multiview Applications
Beginning iOS6 Development CH06 Multiview ApplicationsAbdulrazzaq Alnajjar
 
Topic & Conclusion Sentence Tutorial
Topic & Conclusion Sentence TutorialTopic & Conclusion Sentence Tutorial
Topic & Conclusion Sentence TutorialNinjabob991
 
Adobe Max Modern iPhone App Design with Rick Messer
Adobe Max Modern iPhone App Design with Rick MesserAdobe Max Modern iPhone App Design with Rick Messer
Adobe Max Modern iPhone App Design with Rick MesserRick Messer
 
iOS human interface guidelines(HIG)
iOS human interface guidelines(HIG)iOS human interface guidelines(HIG)
iOS human interface guidelines(HIG)Sun Jin Choi
 
Design guidelines announced in I/O 2014. Material Design by Google by Betaglide
Design guidelines announced in I/O 2014. Material Design by Google by BetaglideDesign guidelines announced in I/O 2014. Material Design by Google by Betaglide
Design guidelines announced in I/O 2014. Material Design by Google by BetaglideManan Shah
 
Android Cheatsheet by RapidValue Solutions
Android Cheatsheet by RapidValue SolutionsAndroid Cheatsheet by RapidValue Solutions
Android Cheatsheet by RapidValue SolutionsRapidValue
 
Faberlic 03 2012_akcenti
Faberlic 03 2012_akcentiFaberlic 03 2012_akcenti
Faberlic 03 2012_akcentiFaberlic Pasaule
 
Faberlic 04 2012_akcenti_lv
Faberlic 04 2012_akcenti_lvFaberlic 04 2012_akcenti_lv
Faberlic 04 2012_akcenti_lvFaberlic Pasaule
 
El marketingmix
El marketingmixEl marketingmix
El marketingmixecosimola
 
Power aulas
Power  aulas Power  aulas
Power aulas ilener
 

Andere mochten auch (15)

Digital literacy wanderley
Digital literacy   wanderleyDigital literacy   wanderley
Digital literacy wanderley
 
BOMDAS-SADMOB
BOMDAS-SADMOBBOMDAS-SADMOB
BOMDAS-SADMOB
 
Beginning iOS6 Development CH03 Handlling Basic Interaction
Beginning iOS6 Development CH03 Handlling Basic InteractionBeginning iOS6 Development CH03 Handlling Basic Interaction
Beginning iOS6 Development CH03 Handlling Basic Interaction
 
Swimming pools lesson 1
Swimming pools lesson 1Swimming pools lesson 1
Swimming pools lesson 1
 
Beginning iOS6 Development CH06 Multiview Applications
Beginning iOS6 Development CH06 Multiview ApplicationsBeginning iOS6 Development CH06 Multiview Applications
Beginning iOS6 Development CH06 Multiview Applications
 
Topic & Conclusion Sentence Tutorial
Topic & Conclusion Sentence TutorialTopic & Conclusion Sentence Tutorial
Topic & Conclusion Sentence Tutorial
 
Noun Groups
Noun GroupsNoun Groups
Noun Groups
 
Adobe Max Modern iPhone App Design with Rick Messer
Adobe Max Modern iPhone App Design with Rick MesserAdobe Max Modern iPhone App Design with Rick Messer
Adobe Max Modern iPhone App Design with Rick Messer
 
iOS human interface guidelines(HIG)
iOS human interface guidelines(HIG)iOS human interface guidelines(HIG)
iOS human interface guidelines(HIG)
 
Design guidelines announced in I/O 2014. Material Design by Google by Betaglide
Design guidelines announced in I/O 2014. Material Design by Google by BetaglideDesign guidelines announced in I/O 2014. Material Design by Google by Betaglide
Design guidelines announced in I/O 2014. Material Design by Google by Betaglide
 
Android Cheatsheet by RapidValue Solutions
Android Cheatsheet by RapidValue SolutionsAndroid Cheatsheet by RapidValue Solutions
Android Cheatsheet by RapidValue Solutions
 
Faberlic 03 2012_akcenti
Faberlic 03 2012_akcentiFaberlic 03 2012_akcenti
Faberlic 03 2012_akcenti
 
Faberlic 04 2012_akcenti_lv
Faberlic 04 2012_akcenti_lvFaberlic 04 2012_akcenti_lv
Faberlic 04 2012_akcenti_lv
 
El marketingmix
El marketingmixEl marketingmix
El marketingmix
 
Power aulas
Power  aulas Power  aulas
Power aulas
 

Ă„hnlich wie Beginning iOS6 Development CH04 More User Interface Fun

iOS Development: What's New
iOS Development: What's NewiOS Development: What's New
iOS Development: What's NewNascentDigital
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of XcodeDhaval Kaneria
 
Mock Objects, Design and Dependency Inversion Principle
Mock Objects, Design and Dependency Inversion PrincipleMock Objects, Design and Dependency Inversion Principle
Mock Objects, Design and Dependency Inversion PrincipleP Heinonen
 
Memory friendly UIScrollView
Memory friendly UIScrollViewMemory friendly UIScrollView
Memory friendly UIScrollViewYuichi Fujiki
 
Assignment1 A 0
Assignment1 A 0Assignment1 A 0
Assignment1 A 0Mahmoud
 
Amazon Lumberyard Interface
Amazon Lumberyard InterfaceAmazon Lumberyard Interface
Amazon Lumberyard InterfacePractical Code, LLC
 
Workshop CQRS and DDD
Workshop CQRS and DDDWorkshop CQRS and DDD
Workshop CQRS and DDDMarijn van Zelst
 
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationVu Tran Lam
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceUnreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceNick Pruehs
 
Android part1
Android part1Android part1
Android part1Aman Agarwal
 
Native Mobile Testing for Newbies
Native Mobile Testing for NewbiesNative Mobile Testing for Newbies
Native Mobile Testing for NewbiesSusan Hewitt
 
iOS storyboard
iOS storyboardiOS storyboard
iOS storyboardMinHyeok Kim
 
What is ui element in i phone developmetn
What is ui element in i phone developmetnWhat is ui element in i phone developmetn
What is ui element in i phone developmetnTOPS Technologies
 
Tapping into Mobile UI with HTML 5
Tapping into Mobile UI with HTML 5Tapping into Mobile UI with HTML 5
Tapping into Mobile UI with HTML 5Yael Sahar
 
[iOS] Basic UI Elements
[iOS] Basic UI Elements[iOS] Basic UI Elements
[iOS] Basic UI ElementsNikmesoft Ltd
 
UI controls in Android
UI controls in Android UI controls in Android
UI controls in Android DivyaKS12
 
5 free tools for web accessibility testing
5 free tools for web accessibility testing5 free tools for web accessibility testing
5 free tools for web accessibility testingJohn McNabb
 

Ă„hnlich wie Beginning iOS6 Development CH04 More User Interface Fun (20)

iOS Development: What's New
iOS Development: What's NewiOS Development: What's New
iOS Development: What's New
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
Mock Objects, Design and Dependency Inversion Principle
Mock Objects, Design and Dependency Inversion PrincipleMock Objects, Design and Dependency Inversion Principle
Mock Objects, Design and Dependency Inversion Principle
 
Visual basic
Visual basic Visual basic
Visual basic
 
Memory friendly UIScrollView
Memory friendly UIScrollViewMemory friendly UIScrollView
Memory friendly UIScrollView
 
Assignment1 A 0
Assignment1 A 0Assignment1 A 0
Assignment1 A 0
 
Amazon Lumberyard Interface
Amazon Lumberyard InterfaceAmazon Lumberyard Interface
Amazon Lumberyard Interface
 
AUTOCAD SOFTWAE ppt
AUTOCAD  SOFTWAE pptAUTOCAD  SOFTWAE ppt
AUTOCAD SOFTWAE ppt
 
Workshop CQRS and DDD
Workshop CQRS and DDDWorkshop CQRS and DDD
Workshop CQRS and DDD
 
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 application
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceUnreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User Interface
 
Android part1
Android part1Android part1
Android part1
 
Native Mobile Testing for Newbies
Native Mobile Testing for NewbiesNative Mobile Testing for Newbies
Native Mobile Testing for Newbies
 
iOS storyboard
iOS storyboardiOS storyboard
iOS storyboard
 
What is ui element in i phone developmetn
What is ui element in i phone developmetnWhat is ui element in i phone developmetn
What is ui element in i phone developmetn
 
Tapping into Mobile UI with HTML 5
Tapping into Mobile UI with HTML 5Tapping into Mobile UI with HTML 5
Tapping into Mobile UI with HTML 5
 
[iOS] Basic UI Elements
[iOS] Basic UI Elements[iOS] Basic UI Elements
[iOS] Basic UI Elements
 
UI controls in Android
UI controls in Android UI controls in Android
UI controls in Android
 
Web dynpro
Web dynproWeb dynpro
Web dynpro
 
5 free tools for web accessibility testing
5 free tools for web accessibility testing5 free tools for web accessibility testing
5 free tools for web accessibility testing
 

KĂĽrzlich hochgeladen

Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 

KĂĽrzlich hochgeladen (20)

Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 

Beginning iOS6 Development CH04 More User Interface Fun

  • 1. User Interface Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 1
  • 2. A Screen Full of Controls • What to learn: – Image view – Text field – Slider – Segmented control – Switch – action sheet – Alert Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 2
  • 3. Controls • Active • Static • Passive – most of the available controls can be used in all three modes. – All iOS controls are subclasses of UIControl. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 3
  • 4. Differences of Controls on iOS • Because of the multitouch interface, all iOS controls can trigger multiple actions depending on how they are touched. • You could have one action fire when the user presses down on a button and a separate action fire when the finger is lifted off the button. • You could have a single control call multiple action methods on a single event. • iOS devices do not have a physical keyboard. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 4
  • 5. Image View • Drag an image view onto the view in the nib editor. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 5
  • 6. Image View • Resizing the Image View – resize the image view to match the size of its contents. select Editor ➤ Size to Fit Content. • Alignment – Editor ➤ Align ➤ Horizontal/Vertical Center in Container • Draw a outline – Editor ➤ Canvas ➤ Show Bounds Rectangles Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 6
  • 7. Image View Attributes • Attributes – The Mode Attribute – Tag – Interaction Checkboxes – The Alpha Value – Background – Drawing Checkboxes – Stretching Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 7
  • 8. Image View Attributes 1) The Mode menu defines how the view will display its content. – choosing any option that causes the image to scale will potentially add processing overhead, so it’s best to avoid those and size images correctly before importing them. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 8
  • 9. Image View Attributes 2) Tags provide an easy, language-independent way of identifying objects on your interface. 3) Interaction Checkboxes: – User Interaction Enabled: specifies whether the user can do anything at all with this object – Multiple Touch: determines whether this control is capable of receiving multitouch events. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 9
  • 10. Image View Attributes 4) Alpha defines how transparent your image is—how much of what’s beneath it shows through. – It’s defined as a floating-point number between 0.0 and 1.0, where 0.0 is fully transparent and 1.0 is completely opaque. 5) Background determines the color of the background for the view. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 10
  • 11. Image View Attributes 6) Drawing Checkboxes: – Opaque: tells iOS that nothing behind this view ever needs to be drawn no matter what. – Hidden: hides an object. – Clears Graphics Context: draws the entire area covered by the object in transparent black before it actually draws the object. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 11
  • 12. Image View Attributes 6) Drawing Checkboxes(cont.): – Clip Subviews: If checked, only the portions of subviews that lie within the bounds of the parent will be drawn. If unchecked, subviews will be drawn completely, even if they lie outside the bounds of the parent. – Autoresize Subviews tells iOS to resize any subviews if this view is resized. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 12
  • 13. Image View Attributes 7) Stretching – The four floating-point values set here let you declare which portion of the rectangle is stretchable by specifying a point at the upper-left corner of the view and the size of the stretchable area, all in the form of a number between 0.0 and 1.0, representing a portion of the overall view size Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 13
  • 14. Text Fields • Grab 2 text fields & 2 labels from the library into the View. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 14
  • 15. Text Field Inspector Settings Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 15
  • 16. Text Field Inspector Settings • Text • Placeholder • font • font color • Background and Disabled. • Border Style • Clear Button & Clear when editing begins checkbox • Adjust to Fit checkbox Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 16
  • 17. Text Field Inspector Settings • Keyboard: – Capitalization – Correction – Keyboard – Appearance – Return Key – Auto-enable Return Key checkbox – Secure checkbox • Control: Enabled checkbox Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 17
  • 18. Creating and Connecting Outlets • s Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 18
  • 19. Closing the Keyboard • In header file: Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 19
  • 20. Closing the Keyboard • In implementation file(before @end): • From connections inspector Drag from the circle next to Did End On Exit to the textFieldDoneEditing: method. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 20
  • 21. Touching the Background to Close the Keyboard • In header file: Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 21
  • 22. Touching the Background to Close the Keyboard • In implementation file(before @end): • Go to identity inspector: change class into UIControl • Connect the view’s Touch Down event to the backgroundTap: action Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 22
  • 23. Slider • A slider lets you choose a number in a given range. • Minimum, Maximum and Current values. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 23
  • 24. Slider Actions and Outlets • Slider Action: Set the Type to UISlider. • Label outlet. • Slider Action method: • Set current value: Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 24
  • 25. Segmented Control & Switches • Segmented Control used to show & hide objects. • Switches are small controls that can have only two states: on and off. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 25
  • 26. Segmented Control & Switches • Add a segmented control & 2 switches. • Create Outlets (rightSwitch, leftSwitch)and one action(switchChanged) for the two switches. – set the Type of its sender to UISwitch. • Create an action(toggleControls) for the segmented control. – set the Type of its sender to UISegmentedControl. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 26
  • 27. Segmented Control & Switches • Switch Actions: Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 27
  • 28. Segmented Control & Switches • Add a button directly on top of the two switches. – create an outlet (doSomethingButton) & an action (buttonPressed). • Check the buttons Hidden checkbox. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 28
  • 29. Segmented Control & Switches • segmented control action: Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 29
  • 30. Action Sheet and Alert • Action sheets are used to force the user to make a choice between two or more items. • Alerts force users to respond before they are allowed to continue using the application Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 30
  • 31. Action Sheet and Alert • Action sheet action: – Then add a method after the buttonPressed: method Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 31
  • 32. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 32
  • 33. viewDidLoad Method • viewDidLoad helps to modify any of the objects that were created in nib file. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 33
  • 34. viewDidLoad Method Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 34
  • 35. viewDidLoad Method • The former code sets the background image for the button. • It specifies that, while being touched, the button should change from using the white image to the blue image. This short method introduces two new concepts: control states and stretchable images. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 35
  • 36. Control States • Every iOS control has four possible control states: – Normal: is the default state. It’s the state that controls are in when not in any of the other states. – Highlighted: is the state a control is in when it’s currently being used. – Disabled: when they have been turned off, which can be done by unchecking the Enabled checkbox in Interface Builder or setting the control’s enabled property to NO. – Selected: It is usually used to indicate that the control is turned on or selected. Selected is similar to highlighted, but a control can continue to be selected when the user is no longer directly using that control. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 36
  • 37. Stretchable Images • A stretchable image is a resizable image that knows how to resize itself intelligently so that it maintains the correct appearance. – Edge insets are the parts of an image, measured in pixels, that should not be resized. Eng. Abdulrazzaq Alnajjar iabdulrazzaq@outlook.com 37