Android LinearLayout : Add border with shadow around a LinearLayout

Try this.. <?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=”#CABBBBBB”/> <corners android:radius=”2dp” /> </shape> </item> <item android:left=”0dp” android:right=”0dp” android:top=”0dp” android:bottom=”2dp”> <shape android:shape=”rectangle”> <solid android:color=”@android:color/white”/> <corners android:radius=”2dp” /> </shape> </item> </layer-list>

How to move and resize a form without a border?

Some sample code that allow moving and resizing the form: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.FormBorderStyle = FormBorderStyle.None; this.DoubleBuffered = true; this.SetStyle(ControlStyles.ResizeRedraw, true); } private const int cGrip = 16; // Grip size private const int cCaption = 32; // Caption bar height; protected override void OnPaint(PaintEventArgs e) { … Read more

Border for an Image view in Android?

I set the below xml to the background of the Image View as Drawable. It works. <?xml version=”1.0″ encoding=”UTF-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android”> <solid android:color=”#FFFFFF” /> <stroke android:width=”1dp” android:color=”#000000″ /> <padding android:left=”1dp” android:top=”1dp” android:right=”1dp” android:bottom=”1dp” /> </shape> And then add android:background=”@drawable/yourXmlFileName” to your ImageView

How to put a border around an Android TextView?

You can set a shape drawable (a rectangle) as background for the view. <TextView android:text=”Some text” android:background=”@drawable/back”/> And rectangle drawable back.xml (put into res/drawable folder): <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle” > <solid android:color=”@android:color/white” /> <stroke android:width=”1dip” android:color=”#4fa5d5″/> </shape> You can use @android:color/transparent for the solid color to have a transparent background. You can also use padding to … Read more

Placing border inside of div and not on its edge

Set box-sizing property to border-box: div { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; width: 100px; height: 100px; border: 20px solid #f00; background: #00f; margin: 10px; } div + div { border: 10px solid red; } <div>Hello!</div> <div>Hello!</div> It works on IE8 & above.

Invert rounded corner in CSS?

Just to update this, it seems you can in multiple ways. Lea Verou posted a solution Here is mine using border-image Using border image html <div><img src=”https://s3.amazonaws.com/resized-images-new/23292454-E6CD-4F0F-B7DA-0EB46BC2E548″ /></div> css div { width: 200px; border-width: 55px; -moz-border-image: url(http://i47.tinypic.com/2qxba03.png) 55 repeat; -webkit-border-image: url(http://i47.tinypic.com/2qxba03.png) 55 repeat; -o-border-image: url(http://i47.tinypic.com/2qxba03.png) 55 repeat; border-image: url(http://i47.tinypic.com/2qxba03.png) 55 repeat; margin: 50px auto; } … Read more

CSS triangle custom border color

You actually have to fake it with two triangles…. .container { margin: 15px 30px; width: 200px; background: #fff; border: 1px solid #a00; position: relative; min-height: 200px; padding: 20px; text-align: center; color: #fff; font: bold 1.5em/180px Helvetica, sans-serif; text-shadow: 0 0 1px #000; } .container:after, .container:before { content: ”; display: block; position: absolute; left: 100%; width: … Read more