xamarin - 如何在 Xamarin 的 ImageView 中设置图像的旋转角度?
问题描述
我正在使用 Xamarin.iOS,现在我想在单击按钮时在 ImageView 中将图像旋转 90 度。我发现了一个类似的问题。但它是用 OC 和 Swift 编写的。如何在 C# 中实现它?我找不到之类的方法CGAffineTransformMakeRotation
。
解决方案
在 Xamarin 中它是CGAffineTransform.MakeRotation
using CoreGraphics;
// 1.5708 is 90 degrees in Radians
myImageView.Transform = CGAffineTransform.MakeRotation(1.5708f);
推荐阅读
- ios - Swift:在 tableView 中保存按钮图像
- java - 无法在 Spring Boot 2/Thymeleaf 3 中显示登录用户
- java - 根据得分找到赢家、输家和平局玩家
- amp-html - 是否可以在 AMP-HTML 中循环播放 vimeo 视频?
- python-3.x - Gekko优化问题中IMODE的选择
- javascript - 使用 React-Redux “connect” 时 App 类中的错误
- php - 什么填充了 Sylius 资源元数据注册表?
- javascript - material-ui:从 onClick() 处理程序中的芯片组件获取标签
- python-3.x - 在标准输入上使用相对导入的 Python 3 脚本给出错误:没有名为 '__main__.XXX' 的模块;'__main__' 不是一个包
- c++ - 无法打印数组或分配给它