How to add a border just on the top side of a UIView

I consider subclassing UIView and overriding drawRect overkill here. Why not add an extension on UIView and add border subviews? @discardableResult func addBorders(edges: UIRectEdge, color: UIColor, inset: CGFloat = 0.0, thickness: CGFloat = 1.0) -> [UIView] { var borders = [UIView]() @discardableResult func addBorder(formats: String…) -> UIView { let border = UIView(frame: .zero) border.backgroundColor = … Read more

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>

Control the dashed border stroke length and distance between strokes

The native dashed border property value does not offer control over the dashes themselves… so bring on the border-image property! Brew your own border with border-image Compatibility: It offers great browser support (IE 11 and all modern browsers). A normal border can be set as a fallback for older browsers. Let’s create these These borders … Read more

CSS/HTML: Create a glowing border around an Input Field

Here you go: .glowing-border { border: 2px solid #dadada; border-radius: 7px; } .glowing-border:focus { outline: none; border-color: #9ecaed; box-shadow: 0 0 10px #9ecaed; } Live demo: http://jsfiddle.net/simevidas/CXUpm/1/show/ (to view the code for the demo, remove “show/” from the URL) label { display:block; margin:20px; width:420px; overflow:auto; font-family:sans-serif; font-size:20px; color:#444; text-shadow:0 0 2px #ddd; padding:20px 10px 10px … Read more

Is it possible to set UIView border properties from interface builder?

Actually you can set some properties of a view’s layer through interface builder. I know that I can set a layer’s borderWidth and cornerRadius through xcode. borderColor doesn’t work, probably because the layer wants a CGColor instead of a UIColor. You might have to use Strings instead of numbers, but it works! layer.cornerRadius layer.borderWidth layer.borderColor … Read more

Android – border for button

Step 1 : Create file named : my_button_bg.xml Step 2 : Place this file in res/drawables.xml Step 3 : Insert below code <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <gradient android:startColor=”#FFFFFF” android:endColor=”#00FF00″ android:angle=”270″ /> <corners android:radius=”3dp” /> <stroke android:width=”5px” android:color=”#000000″ /> </shape> Step 4: Use code “android:background=”@drawable/my_button_bg” where needed eg below: <Button android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Your Text” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)