简体   繁体   中英

Custom theme of a layout in android

I am trying to do this as shown in picture. I want my relative layout to look like this. How can i do that. Themes, styles etc. Just give me hint and ideas

Best Regards

在此输入图像描述

you can try this :

create folder in res called:( drawable ) ,then create XML called ( row_shape.xml ) as shape inside it ,then write this on it :

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
       android:shape="rectangle">
  <stroke android:width="2dp" android:height="2dp" android:color="your color" /> 
  <solid android:color="your color" /> 
  <padding android:left="2dp" android:top="2dp" android:right="2dp"
       android:bottom="2dp" /> 
  <corners android:radius="10dp" android:bottomRightRadius="10dp" 
     android:bottomLeftRadius="10dp" android:topLeftRadius="10dp" 
    android:topRightRadius="10dp" /> 
</shape>

then in layout Xml refer to shape as : android:background="@drawable/row_shape"

HOPE THIS HELP

Because the question is vague, I'm not quite sure where you stand code wise. But here is a link that will bring you to the Android Developer Guide relating to themes and how to implement them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM