-3
<?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
    android:orientation="vertical"
    android:layout_margin="15dp"
    android:padding="2dp">

<WebView 
    android:id="@+id/webview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:onClick="closeActivity"> 
</WebView>
<Button 
    android:layout_alignParentRight="true"
    android:text="@string/x"
    android:textColor="#FFF"
    android:background="@drawable/close"
    android:gravity="center_vertical|center_horizontal"
    android:layout_margin="5dp" 
    android:layout_height="25dp"
    android:layout_width="25dp" 
    android:textSize="12sp" 
    android:textStyle="bold"
    android:onClick="closeActivity"
     /> 

I want that type of a close button can anyone help me out on top of the layout in the webView.

Click Here To see the Pic

Ravi
  • 34,851
  • 21
  • 122
  • 183
  • 3
    your question is unclear.. and usually we add some relevant code to our questions in Stack OverFlow.. – Matan Dahan Feb 03 '14 at 14:17
  • @MatanDahan Can you help me now .. by Button is not on top of the layout as you see in this link https://drive.google.com/file/d/0B9e4GvdISertYUxYMU5iTnZJdlk/edit?usp=sharing – AbhisheK6006 Feb 03 '14 at 14:51

2 Answers2

0

It is easy

  1. Create a custom dialog.
  2. Create a custom layout for that dialog.
  3. Design a custom layout using the Relative layout.

Url for the Creation of the Dialog: http://www.mkyong.com/android/android-custom-dialog-example/

Ahmad
  • 69,608
  • 17
  • 111
  • 137
Balu
  • 1,069
  • 2
  • 10
  • 24
0

you might get what you want by removing the ActionBar at the top of the activity..

add this to your activity (which uses the layout you posted here) in AndroidMenifast.xml

<activity
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
....
>

this code is taken from Here

tell me if it helps..

Community
  • 1
  • 1
Matan Dahan
  • 390
  • 5
  • 10