c# - 使 ImageView 循环

标签 c# ios xamarin.ios uiimageview xamarin

我有一个 ImageView,我正试图在 Xamarin 中制作 Circular。这很简单,我会用 Core Animation 来完成,但是图像是这样异步下载的:

this.profileImage.InvokeOnMainThread (() => this.profileImage.SetImage (
    url: new NSUrl (datum.user.profile_picture)
    )
); 

我如何使这些图像成为圆形?

最佳答案

这就是我最终解决问题的方式:

this.profileImage.InvokeOnMainThread (() => this.profileImage.SetImage (
            url: new NSUrl (datum.user.profile_picture)
        )
    );

// Make Image Profile Image Circular
CALayer profileImageCircle = profileImage.Layer;
profileImageCircle.CornerRadius = 30;
profileImageCircle.MasksToBounds = true;

关于c# - 使 ImageView 循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24332388/

相关文章:

c# - 如何使用 AbotX Javascriptrendering 在网页上覆盖和执行操作

c# - 从内存中读取文件的第一行

ios - 是否有与 Java 的 GlyphVector 或 .NET 的 GraphicsPath 等效的 Xamarin.iOS?

c# - MVC 模式差异

c# - .Net/C# 中远程启动和关闭 Azure 服务器

ios - react native : Pass target Location onPress to google maps or ios maps and execute a GPS Navigation towards said target

ios - Xcode 6.4 - 无法对 View 或任何内容设置约束

ios - iOS 10.3 中的备用图标 : avoid notification dialog for icon change

ios - 有没有全局性的感动事件?

c# - 为什么 catch block 永远不会在设备上执行?