วันนี้หาวิธีทำ Header ชอง Table ให้มี effect แบบแอพหล่อๆ อย่าง Path และเจอเว็บนึงอธิบายไว้ดีมาก และจริงๆ แล้วไม่ได้ยากเลยครับ

ตามลิงค์ไปอ่านได้ >> คลิกเลย
Happy coder / creative thinking
วันนี้หาวิธีทำ Header ชอง Table ให้มี effect แบบแอพหล่อๆ อย่าง Path และเจอเว็บนึงอธิบายไว้ดีมาก และจริงๆ แล้วไม่ได้ยากเลยครับ

ตามลิงค์ไปอ่านได้ >> คลิกเลย
เราสามารถ access parent view ของ UIView และ subclass ของ UIView display object ได้ด้วย property ”superview” เช่น myBtn.superview.frame.size.width สะดวกจุงเบย
การพยายามใช้ event touchesBegan/Moved/Ended ไปพร้อมๆ กับ event scrolling วิธีที่ดีที่สุด คือ ใช้ UIPanGestureRecognizer ช่วยในส่วนของการเคลื่อนที่แทน การใช้ nextResponder ใน touches events
หลังจากหาข้อสรุปมาช่วงนึง ก็ได้เวลาหาข้อมูลจริงๆ จัง จนพอได้ข้อสรุปที่ใช้เป็นแนวทางได้ จึงอยากเอามาแชร์ให้ทุกคน เผื่อจะได้ประหยัดเวลาในการเลือกใช้ api ต่างๆ ที่มีมาให้ (เยอะเหลือเกิน) ใน iOS
Objective-C (iOS) working with audio:
ข้อมูลเพิ่มเติม อ่านต่อได้ ที่นี่
Tips: เราสามารถเช็ค ระยะเวลาการประมวลผลของคำสั่งในแต่ละบรรทัด หรือบล็อคของคำสั่ง ได้ง่ายๆ ด้วยวิธี:
NSDate *startDate = [NSDate date];
….
// processing something here …
…
NSTimeInterval elapsedTimeInterval = [startDate timeIntervalSinceNow];
NSLog(@”>>>>>>>>>>>>>>>> = %f”, elapsedTimeInterval);
ผลลัพธ์ที่ได้เป็นหน่วยวินาที (ติดลบ)
ยังไงๆ ผมก็ว่า การเขียนแฟลชนี่ มีความยืดหยุ่นสูงจริงๆ แต่อาจจะทำให้เรารู้สึกเสียนิสัยและอึดอัดใจในการเขียนโปรแรกมภาษาอื่นๆ ได้ เมื่อไม่มี dynamic variable หรือ object ที่มีความยืดหยุ่นสูงในการใช้งานอย่าง MovieClip
Math: Swing + Gravity + Rotaion = falling leaf ครับ
ว่าแล้ว ลองมาดู pseudo code แบบคร่าวๆ นะครับ
- Generate random leaf
- add force เริ่มต้น gravity, rotation force, swing force
- ขนาดในการเริ่มต้นมีผลต่อ แรง Gravity (Vy), spin + swing
- แยกลูปในการสร้างใบไม้ และลูปในการ animate
- ถ้าใบไม้ล่วงถึงพื้น ให้ลบตัวเองจากกลุ่ม animate
- แสดงเงาบนพื้น
- ตั้งเวลาในการลบตัวเองออกจาก stage เพื่อลด memory
อืมมมม มันส์นิดๆ
To turn it on is so simple as document said but to turn it off after access need specific method. After google around I found this one solution:
video.attachCamera(null);
video.clear();
removeChild(_video);
camera = null;
ref: http://www.ninjabonsai.net/blog/?p=80
I test in an empty fla and it work like a charm. But when I test in my working project which do a lot more of connect and display video. I found that another important trick to do is below:
var cam:Camera = Camera.getCamera( id );
video.attachCamera(null); // this need to set before the next line, always.
video.attachCamera(cam);
I know it weird but it work well for me.
เคสนี้เรียกว่า “ขุดหลุมฝังตัวเอง” เกิดการแสดงขนาดภาพเพี้ยนในเกมส์ จากการพยายาม swap ภาพเองเมื่อ resolution ของ devices สูง
จากกำหนดการแสดงผลของ Application ไว้ที่ resolution ต่ำๆ เช่น 320×480 และทำการแสดงผลภาพบน retina display / ipad corona จะทำการปรับภาพเป็น dynamic scale โดยหากภาพที่ใช้การโหลดรูปแบบ newImageRect() จะได้รับการเปลี่ยนภาพให้โดยอัตโนมัติ เป็นชุด 2x แต่ภาพที่โหลดแบบ newImage() ต้องใส่ parameter เพื่อบังคับให้แสดงแบบไม่ dynamic scale เพิ่ม เมื่อทำการเปลี่ยนภาพเองผ่านโปรแกรม !!
ที่สำคัญ คือ simulator จะไม่แสดง error แต่เมื่อทดสอบใน devices จึงจะพบ…T T
I’m really like this presentation and the ideas of the “Good Design”, thinks that can apply to any kind of work even the web site.
1. Good design is innovative.
2. Good design makes a product useful.
3. Good design is aesthetic.
4. Good design makes a product understandable.
5. Good design is unobtrusive.
6. Good design is honest.
7. Good design is long-lasting.
8. Good design is thorough down to the last detail.
9. Good design is environmentally friendly.
10. Good design is as little design as possible.
Dieter Rams (1985).
Today I’ve try to create a scale 9 shape with gradient fill in its shape and found that when create the scale 9 from IDE the gradient will not slice into scale 9 properly. So the result look like it is stretch. The work around that I found after googling for a while is use “Union” command to the out side border of the scale 9 by select menu “Modify/Objects/Union” and it work !!