Tag

NinePatch

0 views collected around this technical thread.

Tencent Music Tech Team
Tencent Music Tech Team
Sep 15, 2023 · Mobile Development

Parsing and Using NinePatch PNG Images for Resizable UI Elements

The article explains how to create, parse, and use NinePatch (.9.png) images by extracting the custom “npTc” chunk from a PNG file, building a PNGNinePatch object in Objective‑C, and converting its stretchable region data into UIEdgeInsets for resizable iOS UI elements.

AndroidCapInsetsImage Resizing
0 likes · 13 min read
Parsing and Using NinePatch PNG Images for Resizable UI Elements
Tencent Music Tech Team
Tencent Music Tech Team
Jul 27, 2018 · Mobile Development

Understanding Android Nine‑Patch Images: Creation, Usage, and Internals

The article explains Android’s Nine‑Patch format—a bitmap with a 1‑pixel black border defining stretchable and content areas—covers creation methods (Photoshop, Draw9patch, Android Studio), runtime parsing, practical use in network‑loaded chat bubbles, required conversion workflow, and the underlying PNG “npTc” chunk structure with code examples for manual drawable construction.

AndroidMobile DevelopmentNinePatch
0 likes · 20 min read
Understanding Android Nine‑Patch Images: Creation, Usage, and Internals
Tencent Music Tech Team
Tencent Music Tech Team
Aug 26, 2016 · Mobile Development

Dynamic Android UI: Adding Views Programmatically, Drawable Subclasses, and NinePatch Handling

The article explains how Android developers can build dynamic user interfaces by programmatically creating and adding views, replace XML drawables with Drawable subclasses such as StateListDrawable, GradientDrawable, and LayerDrawable, and generate NinePatchChunk data at runtime to use server‑delivered .9.png images without pre‑processing.

AndroidDrawableJava
0 likes · 16 min read
Dynamic Android UI: Adding Views Programmatically, Drawable Subclasses, and NinePatch Handling