How To Display Border To Imageview?

后端 未结 3 698
一个人的身影
一个人的身影 2020-11-28 05:23

Friends How To Display Border To Imageview ?

I Want To Result Like Mobile gallery all image display with border.

plz give me ans thanks for advance....

3条回答
  •  清歌不尽
    2020-11-28 05:47

    I tried all the above solutions but they didn't work for me! So I figured out a simple solution to this! :-)

    I remember that I read about FrameLayout of Android in the following article saying that it helps us to stack up our UI elements on top of each other in the same order we add them up.

    Solution:

    
        android:layout_marginRight="16dp" 
        android:layout_centerVertical="true">
        
        
        
        
        
    
    

    Preview:

    And that's it. You will get the following like imageView!

    preview of the ImageView with boarder

    Pros and Cons:

    I think this is pretty easy solution to be used in anywhere else and it's all the things you do sits in one single place so easier to modify it. However I don't like to having to add two ImageViews.

提交回复
热议问题