-2

I have a android webview as below :

<WebView
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:id="@+id/userImage"
        android:background="@drawable/circle"/>

I have to show this webview in circle shape. I am new to android. Googled and tried many codes. But it is not working. Can any one please give me drawable code to show webview in circled shape just as in whattsapp user images.

Ijas Ahamed N
  • 5,632
  • 5
  • 31
  • 53
  • check this helpful one: http://stackoverflow.com/questions/11675436/android-give-a-webview-rounded-corners – Androider Dec 02 '15 at 11:46

2 Answers2

0

This is webview layout

<FrameLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingTop="10dip"
    android:paddingBottom="10dip"
    android:paddingLeft="1dip"
    android:paddingRight="1dip"
    android:background="@drawable/white_rounded_area"
    >
<WebView
        android:id="@+id/web_view"
        android:layout_width="300dip"
        android:layout_height="400dip"
        android:layout_gravity="center"
        />
</FrameLayout>

rounded.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle" android:padding="10dp">
    <solid android:color="#000"/>
    <corners
         android:bottomRightRadius="15dp"
         android:bottomLeftRadius="15dp"
         android:topLeftRadius="15dp"
         android:topRightRadius="15dp"/>
 </shape>

This code works for me check this link

Community
  • 1
  • 1
-2

Create new xml circle.xml and paste this code
.

<?xml version="1.0" encoding="utf-8"?>
<!--  Created by FirozShaikh on 02/12/2015. -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="oval">
    <size
        android:height="100dp"
        android:width="100dp" />
    <solid android:color="@color/blue"/>
</shape>
GreenROBO
  • 4,725
  • 4
  • 23
  • 43