rounded-corners

ImageView rounded corners

∥☆過路亽.° 提交于 2019-11-27 11:48:31
I wanted image to have rounded corners. I implement this xml code and use this in my image view. but image overlap the shape. I am downloading the image through async task. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:radius="20dip" /> </shape> <ImageView android:id="@+id/trVouchersImage" android:layout_width="55dp" android:layout_height="55dp" android:layout_marginLeft="8dp" android:layout_centerVertical="true" android:layout_centerHorizontal="true" android:layout_alignParentLeft="true"

How to programmatically round corners and set random background colors

≯℡__Kan透↙ 提交于 2019-11-27 10:35:22
I'd like to round the corners of a view and also change the color of the view based on the contents at runtime. TextView v = new TextView(context); v.setText(tagsList.get(i)); if(i%2 == 0){ v.setBackgroundColor(Color.RED); }else{ v.setBackgroundColor(Color.BLUE); } v.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); v.setPadding(twoDP, twoDP, twoDP, twoDP); v.setBackgroundResource(R.drawable.tags_rounded_corners); I was hoping setting a drawable and color would overlap, but they do not. Whichever one I execute second is the resulting background. Is there

Border over a bitmap with rounded corners in Android

你离开我真会死。 提交于 2019-11-27 08:04:01
I used the below to make a bitmap with rounded corners. Now I want to draw a line around the bitmap. private BitmapDrawable roundCornered(BitmapDrawable scaledBitmap, int i) { Bitmap bitmap = scaledBitmap.getBitmap(); result = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); canvas = new Canvas(result); color = 0xff424242; paint = new Paint(); rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); rectF = new RectF(rect); roundPx = i; paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(Color.BLUE); canvas.drawRoundRect(rectF, roundPx

WPF rounded corner textbox

大城市里の小女人 提交于 2019-11-27 07:34:14
I don't know WPF and am now learning it. I was looking for rounded corners TextBox in WPF. So I searched Google and found a piece of XAML : <!–Rounded Corner TextBoxes–> <ControlTemplate x:Key=”RoundTxtBoxBaseControlTemplate” TargetType=”{x:Type Control}”> <Border Background=”{TemplateBinding Background}” x:Name=”Bd” BorderBrush=”{TemplateBinding BorderBrush}” BorderThickness=”{TemplateBinding BorderThickness}” CornerRadius=”6″> <ScrollViewer x:Name=”PART_ContentHost”/> </Border> <ControlTemplate.Triggers> <Trigger Property=”IsEnabled” Value=”False”> <Setter Property=”Background” Value=”

How to make round corners to both inside of a box and its border?

六月ゝ 毕业季﹏ 提交于 2019-11-27 07:33:29
I guess the title is kind of hard to understand, so I'll explain. I am trying to achieve this effect: (a box which has rounded corners and its border, which also has rounded borders). I've managed to do this, by using the background-clip property: (rounded corners for border but not for inner box) The question is, how can I achieve rounded corners for the inner box? Thank you! EDIT The HTML I am using: <header class="body template-bg template-border radius-all"> <nav> <ul> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4</a>

Removing rounded edges of a customized Seekbar?

蓝咒 提交于 2019-11-27 06:58:28
问题 I'm trying to customize a seekbar. I have this mostly working, but I am not able to remove the rounded edges of this seekbar. I know there are many questions regarding this, and that applying corners 0dp will help, but I don't know where to implement this shape. When I try to display the shape, it's getting sharp edges but my background is not showing, it's showing a black rectangular shape. I want to have sharp edges with my background. seekbarprogrss.xml <?xml version="1.0" encoding="utf-8"

Rounded table corners CSS only

↘锁芯ラ 提交于 2019-11-27 06:56:42
I have searched and searched, but haven't been able to find a solution for my requirement. I have a plain ol' HTML table. I want round corners for it, without using images or JS, i.e. pure CSS only . Like this: Rounded corners for corner cells, and 1px thick border for the cells. So far I have this: table { -moz-border-radius: 5px !important; border-collapse: collapse !important; border: none !important; } table th, table td { border: none !important } table th:first-child { -moz-border-radius: 5px 0 0 0 !important; } table th:last-child { -moz-border-radius: 0 5px 0 0 !important; } table tr

How is a rounded rect view with transparency done on iphone?

陌路散爱 提交于 2019-11-27 05:59:50
A lot of apps pop up a transparent view with rounded corners and an activityIndicator when running a time consuming operation. How is this rounding done and is it possible to do it just using Interface Builder (as there are lots of places I'd like to use something like this)? Or, should I use an imageview with a rounded rect or stretchable image? Do I need to draw the background myself? So far, I have managed to get a basic view with similar transparency by setting the alphaValue in Interface Builder however it doesn't have rounded corners, and also the transparency seems to apply to all

C# Form with custom border and rounded edges [duplicate]

穿精又带淫゛_ 提交于 2019-11-27 05:17:26
This question already has an answer here: How to Draw a Rounded Rectangle with WinForms (.NET)? 5 answers I am using this code to make my form (FormBorderStyle=none) with rounded edges: [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] private static extern IntPtr CreateRoundRectRgn ( int nLeftRect, // x-coordinate of upper-left corner int nTopRect, // y-coordinate of upper-left corner int nRightRect, // x-coordinate of lower-right corner int nBottomRect, // y-coordinate of lower-right corner int nWidthEllipse, // height of ellipse int nHeightEllipse // width of ellipse ); public

Rounded edges in button C# (WinForms)

隐身守侯 提交于 2019-11-27 04:51:21
Hello, through some research around here and other sites, I've made a rounded edges button. protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Rectangle Rect = new Rectangle(0, 0, this.Width, this.Height); GraphicsPath GraphPath = new GraphicsPath(); GraphPath.AddArc(Rect.X, Rect.Y, 50, 50, 180, 90); GraphPath.AddArc(Rect.X + Rect.Width - 50, Rect.Y, 50, 50, 270, 90); GraphPath.AddArc(Rect.X + Rect.Width - 50, Rect.Y + Rect.Height - 50, 50, 50, 0, 90); GraphPath.AddArc(Rect.X, Rect.Y + Rect.Height - 50, 50, 50, 90, 90); this.Region = new Region(GraphPath); } The problem I'm