GAMA
GAMA

Reputation: 5996

Styling of button in mono for android

I'm absolute beginner when it comes to mono for android.

Referring to below screenshot, the default button style (left image) doesn't look good here. So I want to change it to exact rectangle (right image) and not rounded-rectangle(the default one).

Any idea on this?

Any xml file need to be added?

As I'm very new to this, any help will be appreciated !!

screen

Upvotes: 0

Views: 2170

Answers (1)

RajaReddy PolamReddy
RajaReddy PolamReddy

Reputation: 22493

use this code for creating rounded corners button background

res/drawable/rounded_bg.xml

<?xml version="1.0" encoding="utf-8"?>
<!--  res/drawable/rounded_bg.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
   android:shape="rectangle" android:padding="10dp">
   <solid android:color="@color/blue1"/>
   <corners
       android:bottomRightRadius="5dp"
       android:bottomLeftRadius="5dp"
   android:topLeftRadius="5dp"
   android:topRightRadius="5dp"/>  
</shape>

and use that as background for your button

android:background="@drawable/rounded_bg" 

Upvotes: 1

Related Questions