<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Witchuda Chobchuenchom on Medium]]></title>
        <description><![CDATA[Stories by Witchuda Chobchuenchom on Medium]]></description>
        <link>https://medium.com/@witchuda-chobchuenchom?source=rss-d06fb0a74dc1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rPmXiDGzjAaTKuU6d4F7_w.jpeg</url>
            <title>Stories by Witchuda Chobchuenchom on Medium</title>
            <link>https://medium.com/@witchuda-chobchuenchom?source=rss-d06fb0a74dc1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 19:10:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@witchuda-chobchuenchom/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[อยากใส่ Image Background ใน Flex Message ทำอย่างไร]]></title>
            <link>https://witchuda-chobchuenchom.medium.com/%E0%B8%AD%E0%B8%A2%E0%B8%B2%E0%B8%81%E0%B9%83%E0%B8%AA%E0%B9%88-image-background-%E0%B9%83%E0%B8%99-flex-message-%E0%B8%97%E0%B8%B3%E0%B8%AD%E0%B8%A2%E0%B9%88%E0%B8%B2%E0%B8%87%E0%B9%84%E0%B8%A3-133b2b99896e?source=rss-d06fb0a74dc1------2</link>
            <guid isPermaLink="false">https://medium.com/p/133b2b99896e</guid>
            <category><![CDATA[flexmessage]]></category>
            <category><![CDATA[message-api]]></category>
            <category><![CDATA[line-oa]]></category>
            <category><![CDATA[linedevth]]></category>
            <category><![CDATA[linemessagingapi]]></category>
            <dc:creator><![CDATA[Witchuda Chobchuenchom]]></dc:creator>
            <pubDate>Thu, 08 Apr 2021 02:09:05 GMT</pubDate>
            <atom:updated>2021-04-11T18:10:43.539Z</atom:updated>
            <content:encoded><![CDATA[<p>เคยสงสัยกันไหมคะว่า…</p><p>พื้นหลังของ Flex Message เปลี่ยนได้แค่สีเหรอ?</p><p>ถ้าอยากใส่รูปแทนหล่ะ ทำได้ไหม?</p><p>Showcase ใน Simulator ยังไม่มีเลย ทำไม่ได้หรอก</p><p>วันนี้แนนจะมาตอบข้อสงสัยเหล่านี้ให้ค่ะ</p><p>สมมติว่า แนนอยากทำการ์ดเพลงหน้าตาแบบนี้</p><p>เราจะต้องทำยังไงนร๊าาาาา</p><p>(ขอยืมรูปตัวอย่าง LINE มาก่อนนะคะ :P)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*l8eW7fsgVXGtWtbOKE-amA.png" /></figure><p>ขอเกริ่นก่อนนะคะว่า Flex Message แบ่งออกเป็น 4 ส่วนคือ</p><p>Header, Hero, Body, และ Footer</p><p>(ศึกษาเพิ่มเติมได้จาก link <a href="https://developers.line.biz/en/reference/messaging-api/#flex-message">https://developers.line.biz/en/reference/messaging-api/#flex-message</a> นี้ค่ะ)</p><p>ซึ่งเราจะมาใส่ Image Background ที่ Hero กันค่ะ</p><p>เริ่มแรกเราเข้าไปที่ Simulator กันก่อน (<a href="https://developers.line.biz/flex-simulator/">https://developers.line.biz/flex-simulator/</a>)</p><p>ทาง LINE ได้ทำตัวอย่างมาให้คร่าวๆแล้ว</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1-8ExgXKC_CLAaRQNKlSw.png" /></figure><p>แต่… เราจะไม่ใช้ค่ะ ลบออกค่ะ 555555</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56swj17bM0YDwFFf2gpsow.png" /></figure><p>โดนคาดแดงเลยทีเดียว &gt;.&lt;</p><p>เป็นเพราะว่า Flex Message ต้องมีอย่างน้อย 1 component ที่ส่วนไหนก็ได้</p><p>มาค่ะ มาต่อกัน</p><p>กด + เพื่อเพิ่ม box ในส่วนของ Hero</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3FHTzJIQhSPhS5XuUhFCcg.png" /></figure><p>ok ไม่แดงแล้ว และก็ไม่แสดงอะไรด้วย 5555</p><p>(แต่ถ้าเพิ่ม Box ในส่วนอื่นที่ไม่ใช่ Hero จะแสดงแถบขาวๆให้นะ)</p><p>ต่อไป เรามาจะเพิ่มอีก 2 box ภายใต้ box เมื่อสักครู่กัน</p><p>งงกันใช่ไหม ว่าทำไม ?</p><p>คืองี้… เนื่องจากใน Hero สามารถใส่ได้แค่ 1 component คือ box หรือ image เท่านั้น</p><p>แต่เราต้องการให้มี 2 component คือ text และ image</p><p>โดยที่ text วางซ้อนอยู่บน image</p><p>นี่จึงเป็นเหตุผลว่าทำไมนะ ทำไม ถึงต้องมี 2 box</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qtzVVBzX4mAfI9HPbfb1NQ.png" /></figure><p>ต่อไปเราจะมาใส่ image ลงใน box แรก</p><p>(แนนปรับ size image ให้เป็น full นะคะ)</p><p>และ text ลงใน box ที่สอง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ecMW-ALmSTGiM6AwlRhrFg.png" /></figure><p>ซึ่งตอนนี้ text ถูกวางต่อท้าย image</p><p>(ดูได้จากการเอาเม้าส์ไปวางที่แต่ละ component ด้านขวามือ</p><p>จะมีกรอบสีเทาๆ แสดงพื้นที่ของ component นั้นๆด้านซ้ายมือ)</p><p>ขั้นตอนสำคัญในการให้ text ไปวางซ้อนบน image คือ…</p><p>กำหนด position ของ box (text) ให้เป็น absolute</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ppUWrALfwJQlw4lsIyW4g.png" /></figure><p>เย้ !!!!</p><p>ตอนนี้ text ย้ายมาอยู่ข้างบนแล้ว</p><p>แล้วเราจะขยับ text มาให้ตรงกับ image ยังไงดีนะ</p><p>อันนี้เป็นเรื่องของการตกแต่งล้วนๆค่ะ</p><p>อย่างแนนจะใส่ Margin ของ Text เป็น 100px ค่ะ</p><p>ข้อความก็จะขยับลงมาแล้วค่ะ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dQ5FezU-dUUjchfvndLXiw.png" /></figure><p>ที่เหลือ เราก็ไปปรับ/เพิ่ม ส่วนต่างๆ ให้ตรงตามที่เราอยากได้ค่ะ</p><p>ซึ่งแนนก็ทำเรียบร้อยแล้วตามรูปแรกที่แสดงไป</p><p>ส่วนด้านล่างนี้คือ json ที่แนนทำไปนะคะ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3c23b20e70667dc99b6624fcf3a43d5/href">https://medium.com/media/c3c23b20e70667dc99b6624fcf3a43d5/href</a></iframe><p>สำหรับวันนี้ข้อสงสัยของใครหลายๆ คนก็คลายกันไปเรียบร้อยแล้ว</p><p>ขอให้ทุกคนสนุกกับการทำ Flex Message นะคะ</p><p>เจอกันในบทความถัดไปค่ะ</p><p>ขอบคุณค่ะ :D</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=133b2b99896e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>