How to set a border around a circular image view like Instagram?


Paris:

I want to set a circle border around a circle picture view like instagram stories, can anyone help? this is my image view

<de.hdodenhof.circleimageview.CircleImageView
    android:id="@+id/profile_image"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:layout_marginStart="10dp"
    android:layout_marginTop="8dp"
    android:src="@drawable/profile1"
    app:civ_border_color="#DBDBDB"
    app:civ_border_width="1dp"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />
Gabriele Mariotti:

You can also use the ones provided by the material component library.ShapeableImageView

It's just like:

<com.google.android.material.imageview.ShapeableImageView
    app:shapeAppearanceOverlay="@style/circularImageView"
    app:srcCompat="@drawable/...."
    app:strokeColor="@color/....."
    app:strokeWidth="1dp"
    ...
    />

and:

  <style name="circularImageView">
    <item name="cornerFamily">rounded</item>
    <item name="cornerSize">50%</item>
  </style>

enter image description here

Note: it requires at least version .1.2.0-alpha03

Related


How to put a multicolor border around a circular image?

Sykes I need to put a colored border around a circular image. Border example I've tried various guides online but can't seem to get the hang of it. I tried using a linear gradient, but I ended up with 4 points at the corners, as if the image were square with n

How to put a multicolor border around a circular image?

Sykes I need to put a colored border around a circular image. Border example I've tried various guides online but can't seem to get the hang of it. I tried using a linear gradient, but I ended up with 4 points at the corners, as if the image were square with n

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

How to add zigzag border to circular image view

Chashu I have an image view and I need to add a zigzag border to it like an image How can I do this? Any help is appreciated. Thank Chakshu Arora Jon Simple example using straight lines (curves are more complex, I recommend creating masks in a paint program if

set border around image bootstrap

Avaso I'm currently trying to set a border around the image, but unfortunately bootstrap doesn't make it easy. It seems they add padding to the columns to prevent the borders from fitting. I'm not sure if there is a way to do this without removing the padding

set border around image bootstrap

Avaso I'm currently trying to set a border around the image, but unfortunately bootstrap doesn't make it easy. It seems they add padding to the columns to prevent the borders from fitting. I'm not sure if there is a way to do this without removing the padding

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to set outline border for circular image using CSS?

coding geek I have an image that is 200 X 200px in size, just set it border-radius:50%as below and it will display the circular image. #circularimg { border-radius: 50%; border-style:solid; border-width:5px; } The border is set, 5pxbut the picture

How can I set a transparent border around an image using CSS?

microphone I'm trying to create an oval shape on hover when someone hovers over a link. By doing this, I lost the image that was part of the link. I know what I'm doing wrong but what? .pagelinks { float: right; margin-right: 48%; display: inline-block;

How can I set a transparent border around an image using CSS?

microphone I'm trying to create an oval shape on hover when someone hovers over a link. By doing this, I lost the image that was part of the link. I know what I'm doing wrong but what? .pagelinks { float: right; margin-right: 48%; display: inline-block;

How to make a circular border around social icons?

Nick Allaire .icon { padding: 5px 10px; display: inline-block; -moz-border-radius: 100px; -webkit-border-radius: 100px; border-radius: 100px; -moz-box-shadow: 0px 0px 2px #888; -webkit-box-shadow: 0px

How to draw a border around a circular ImageView in Android?

Filip Luchianenco What I achieved is to convert the given image from a square to a circle, but now I can't get the border, just a simple white border around it. public class RoundedImageView extends ImageView { public RoundedImageView(Context context) { s

How to make a circular border around social icons?

Nick Allaire .icon { padding: 5px 10px; display: inline-block; -moz-border-radius: 100px; -webkit-border-radius: 100px; border-radius: 100px; -moz-box-shadow: 0px 0px 2px #888; -webkit-box-shadow: 0px

How to remove the image around the border

Edwin So I have a question. I used sprites for the first time and now borders appear around them, I tried setting border: none, but it didn't work. demo <div class="service"> <img href="image/icons.png" style="background-image:url('image/icons.png'); backgroun

How to remove the image around the border

Edwin So I have a question. I used sprites for the first time and now borders appear around them, I tried setting border: none, but it didn't work. demo <div class="service"> <img href="image/icons.png" style="background-image:url('image/icons.png'); backgroun

How to set circular image?

Kinjal Gohil How to display circular image from rectangular image using bootstrap? Here is the possible circle code; <img src="cinqueterre.jpg" class="img-circle" alt="Cinque Terre" > But this only works for square images, for rectangular images it becomes a