Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6780517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:30:55+00:00 2026-05-26T16:30:55+00:00

I have LinearLayout with shape background and WebView inside. How to cut WebView along

  • 0

I have LinearLayout with shape background and WebView inside. How to cut WebView along the border of the shape?

I want WebView fit in the shape and so WebView will not have any acute angles.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:padding="5dip" >

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/bg_border"
    android:orientation="vertical" >

    <WebView android:id="@+id/webview" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" />

    </LinearLayout>
</LinearLayout>

bg_border.xml

<?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
<stroke
    android:width="1dp"
    android:height="1dp"
    android:color="@color/border" />

<corners
    android:radius="5dp"
    android:bottomRightRadius="5dp"
    android:bottomLeftRadius="5dp"
    android:topLeftRadius="5dp"
    android:topRightRadius="5dp" />

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:30:56+00:00Added an answer on May 26, 2026 at 4:30 pm

    I would bet you can only simulate that. Create another shape with a (smaller) radius, and make it white. Put that around your web view. This obviously won’t work if the page you’re looking at is not white.

    Also, you don’t need to define topLeft/bottomRight/etc if you already define “radius” and all the values are the same.

    UPDATE
    Ideas. Both of them involve a source image LIKE this: http://www.noiseindustries.com/downloads/misc/FxFactoryHelp/pluginguide/generators/roundedrectangle/files/ni-rounded-rectangle.jpg

    Just make sure the border is MUCH smaller. 3-5 pixels. The white center should be transparent, not white.

    1) Create a RelativeLayout, and create images for the sides and corners. With the layout and images, basically lay out the images so you “draw” a border. Don’t put anything in the center. Create a FrameLayout, put the webview in, then put the RelativeLayout on top. Hopefully, the touch events in the center will fall through to the webview, but still give you a soft border around the edges.

    2) Create a 9-patch image that basically looks the same as the border described in 1. Do the same FrameLayout described in 1, and add the Webview. On top of that, add a CUSTOM view. Set the background to the 9-patch, and make sure the custom view passes on all of its touch events.

    I suspect #1 would be easier to implement, but who knows?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Layout which does not work: <LinearLayout android:orientation=horizontal android:layout_width=match_parent android:id=@+id/experienceLayout android:background=#ffffff
I have a LinearLayout that I would like to change the background color of
I have a simple horizontal LinearLayout with four TextViews with the same style inside.
I have a FrameLayout with a vertical LinearLayout inside. I have an ImageView that
I have a LinearLayout A which is set inside onCreate() method by setContentView(), However
Hi I have a LinearLayout, inside there is a TableLayout 1st row, contains a
I have a drawable that i use as a Background for a LinearLayout. I
I have a LinearLayout, which only contains one button. I want this button to
I have a linearlayout with 3 imageView and a listview in vertical orientation.i want
I have a LinearLayout view that already contains several elements. I want to add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.