Judul : How to Add One Side Left Border in Android using XML
link : How to Add One Side Left Border in Android using XML
How to Add One Side Left Border in Android using XML
How to Add One Side Left Border in Android using XML
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
tools:context="com.android_examples.onesidebordertextview_android_examplescom.MainActivity">
<TextView
android:layout_width="fill_parent"
android:layout_height="100dp"
android:text="This is Sample TextView Text."
android:background="@drawable/text_style"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_margin="12dp"
android:textSize="20dp"
android:textColor="#000"
/>
</RelativeLayout>
text_style.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#F44336"/>
</shape>
</item>
<item android:left="4dp">
<shape android:shape="rectangle">
<solid android:color="#FFEB3B"/>
</shape>
</item>
</layer-list>
That's the articleHow to Add One Side Left Border in Android using XML
You are now reading the articleHow to Add One Side Left Border in Android using XML with link addresshttps://inabnonapudyawanabing.blogspot.com/2021/05/how-to-add-one-side-left-border-in.html
0 Response to "How to Add One Side Left Border in Android using XML"
Post a Comment