Moment For Technology

Android development, using XML drawable to make a border with the background image

Posted on Aug. 26, 2023, 4:09 a.m. by Matiu Bell-Gilbert
Category: The back-end Tag: The back-end

In Android development, when the border needs to be set, the background image is used to achieve it, and the code is as follows:

layer-list xmlns:android=""  ! - even the frame color value -   item   shape   solid android: color = "# CCCCCC" /   / shape   / item  ! item android:bottom="1dp" Android :left=" 1DP "Android :right=" 1DP" Android :top=" 1DP " ! shape solid Android :color="# FFFFFF "/ /shape /item /layer-listCopy the code

In this case, adjust the bottom part according to your actual needs and control the display of the top, bottom, left and right borders.

Copy the code
About (Moment For Technology) is a global community with thousands techies from across the global hang out!Passionate technologists, be it gadget freaks, tech enthusiasts, coders, technopreneurs, or CIOs, you would find them all here.