android - Xamarin 上的圆形 ImageView

标签 android xamarin imageview xamarin.android

我正在开发 Xamarin Android 应用程序,我需要制作一个 Circular ImageView

如何实现?

最佳答案

我使用 RoundedImageView图书馆。它是用 Java 编写的,但您可以 write a binding没有太大问题。完成后,您只需将其添加到您的 .axml 中即可:

<RoundedImageView
    local:riv_corner_radius="15dp"
    local:riv_oval="false"
    android:scaleType="centerCrop"
    android:layout_width="30dp"
    android:layout_height="30dp" />

为 future 的读者编辑:我基于这篇文章中链接的库,为 Xamarin.Android 编写了 RoundedImageView 的端口。源代码可以找到here和 NuGet 包 here . MvxRoundedImageView 也包括在内,用于 MvvmCross。

关于android - Xamarin 上的圆形 ImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32098345/

相关文章:

android - TextView中的隐藏字段/标签?

android - 如何在 zxing 中触发批量模式扫描

android - 使用 <object> html 标签在 android 上显示 pdf 的问题

Android水平LinearLayout在TextView中带有包装文本

c# - 使用 ObservableCollection 实现模态

ios - 在 VS for Mac 中无法查看个人团队配置文件

android - 无法构建 Xamarin Android 项目 : An outdated of 'Android SDK Build-tools' is in use

Android ImageView 触摸

Swift 3/Xcode 文本对齐到 imageview

android - 在 Toolbar 和 LinearLayout 之间的左侧无法解释的间隙/填充