Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone



Clound SSD Virtual Server

iOS/iPhone Storyboard Segue and Push Action Segues (Objective-C,iPhone,iPad)

iOS/iPhone Storyboard Segue and Push Action Segues (Objective-C,iPhone,iPad) สำหรับ Action Segue แบบ Push ซึ่งจะมีความหมายว่า ดัน หรือ ผลัก นั่นหมายถึงว่าเป็นการสร้าง Action Segue ไปยัง View ถัดไป และสามารถที่จะทำการย้อนกลับมายัง View ก่อนหน้านี้ได้ ซึ่ง Segue แบบ Push จะพบเห็นได้กับทุก ๆ App ที่เราใช้งาน หรือแม้กระทั่งการใช้ App ของ Apple ที่มากับเครื่อง ก็มีการใช้ Segue แบบ Push เกือบทุก App เช่นเดียวกัน

iOS/iPhone Storyboard Segue and Push Segues

iOS/iPhone Storyboard Segue and Push Action Segues


ในการสร้าง Action แบบ Segue แบบ push จะนิยมสร้างร่วมกับ Storyboard ทำงานร่วมกับ Navigation Controller ผ่านการ Drag and Drop ซึ่งจะสามารถสร้าง Action ได้ง่าย ๆ โดยใช้เวลาไม่ถึง 1 นาทีด้วยซ้ำ

ตัวอย่างการสร้าง Action Segue แบบ Push บน Xcode แสดงผลบน iPhone

iOS/iPhone Storyboard Segue and Push Segues

เริ่มต้นด้วยการสร้าง Project แบบ Single View Application

iOS/iPhone Storyboard Segue and Push Segues

เลือก Use Storyboard

iOS/iPhone Storyboard Segue and Push Segues

คลิกที่ Storyboard ซึ่งตอนนี้จะมี View ที่เป็นค่า Default อยู่ 1 View

iOS/iPhone Storyboard Segue and Push Segues

ทดสอบการสร้าง Button และ Label ดังรูป

iOS/iPhone Storyboard Segue and Push Segues

คลิกที่ Editor -> Embed In -> Navigation Controller

iOS/iPhone Storyboard Segue and Push Segues

ซึ่งตอนนี้ View จะมี Navigation Controller มาควบคุมการทำงานก่อนที่จะแสดง View นั้น ๆ

iOS/iPhone Storyboard Segue and Push Segues

ทดสอบแก้ไข Title ของ View

iOS/iPhone Storyboard Segue and Push Segues

สร้าง View ขึ้นมาใหม่ด้วยการลาก Object ที่มีชื่อว่า View Controller มาไว้ใน Storyboard

iOS/iPhone Storyboard Segue and Push Segues

ใส่ Label ว่า View 2

iOS/iPhone Storyboard Segue and Push Segues

กลับมายัง View 1 ให้คลิกที่ Button แล้วกดปุ่ม Control บน Keyboard จากนั้นลากไปยัง View ที่ 2

iOS/iPhone Storyboard Segue and Push Segues

เลือก Action Segue เป็นแบบ push (การสร้าง Action Segue แบบ push จะต้องสร้างภายใต้ Navigation Controller ไม่ฉะนั้นจะรันแล้ว Error)

iOS/iPhone Storyboard Segue and Push Segues

เปลี่ยนชื่อ Title ของ View 2 ซึ่งจะเห็นว่าใน View 2 จะมี Navigation Bar ขึ้นมาอัตโนมัติ ซึ่งเป็นผลมาจากการใช้ Segue แบบ push

Screenshot

iOS/iPhone Storyboard Segue and Push Segues

แสดง View ที่ 1 สามารถคลิกที่ Button เพื่อเชื่อมโยงไปยัง View ที่ 2

iOS/iPhone Storyboard Segue and Push Segues

แสดง View ที่ 2 ซึ่งจะมีปุ่ม Back สามารถย้อนกลับไปยัง View ที่ 1

เพิ่มเติม
จากตัวอย่างเป็นเพียงการสร้าง Action Segue แบบ Push เพียงแค่ 2 Level เท่านั้น แต่ในทางปฏิบัติสามารถสร้าง ได้หลาย Level ขึ้นอยู่กับความต้องการ และยังสามารถสร้าง Action Segue รูปแบบอื่น ๆ ทำงานร่วมกับ Push ได้เช่นเดียวกัน

iOS/iPhone Storyboard Segue and Push Segues

ตัวอย่างการสร้าง Action Segue แบบ Push ที่มีอยู่ 3 Level ประกอบด้วย 3 View






   
Share

Property & Method (Others Related)

iOS/iPhone Storyboard Action Segue and View (Objective-C,iPhone,iPad)
iOS/iPhone Storyboard Segue and Modal Action Segues (Objective-C,iPhone,iPad)
iOS/iPhone Storyboard Segue and Custom Action Segues (Objective-C,iPhone)

ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท


ลองใช้ค้นหาข้อมูล


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2012-10-29 15:18:39 / 2012-10-30 17:21:38
  Download : Download  iOS/iPhone Storyboard Segue and Push Action Segues (Objective-C,iPhone,iPad)
 Sponsored Links / Related

 
iOS/iPhone Collection View and Master Detail (Objective-C, iPhone, iPad)
Rating :

 
iOS/iPhone Page Control (UIPageControl) and ScrollView (UIScrollView) (iPhone, iPad)
Rating :

 
iOS/iPhone Hide Input Keyboard and Validate Text Field (Password, Number, URL, E-Mail, Phone Number)
Rating :

 
iOS/iPhone AD BannerView (iAd Framework)
Rating :

 
iOS/iPhone Table View Show Enable Edit / Delete Cell (Swipe To Delete) (UITableView)
Rating :

 
iOS/iPhone Search Data from Web Server (URL,Website)
Rating :

 
iOS/iPhone Edit Update Data on Web Server (URL,Website)
Rating :

 
iOS/iPhone Delete Remove Data on Web Server (URL,Website)
Rating :

 
iOS/iPhone Register Form and Send Data to Web Server (PHP & MySQL)
Rating :

 
iOS/iPhone Login Username and Password from Web Server (PHP & MySQL)
Rating :


ThaiCreate.Com Forum


Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   







Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่