[英]Xamarin forms: Image is not showing in perfect circle
I already posted a question regarding this issue, never get any solution. 我已经发布了有关此问题的问题,但从未得到任何解决方案。 So posting the same question with more details and findings.
因此,发布具有更多详细信息和发现的相同问题。
For the circle images, I am using Xam.Plugins.Forms.ImageCircle nuget package in my project, which is working fine in android and windows but showing an oval shape in IOS, screenshot adding below. 对于圆形图像,我在项目中使用Xam.Plugins.Forms.ImageCircle nuget程序包,该程序在android和windows上运行良好,但在IOS中显示为椭圆形,下面添加了屏幕截图。
Added ImageCircleRenderer.Init(); 添加了ImageCircleRenderer.Init(); in AppDelegate.cs.
在AppDelegate.cs中。
xmlns namespace added: xmlns名称空间已添加:
xmlns:controls="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin.Abstractions"
<controls:CircleImage
HorizontalOptions="Start"
VerticalOptions="Start"
Margin="0,0,0,-5"
WidthRequest="50"
Aspect="AspectFill"
BorderColor="#1C7DB4"
BorderThickness="2"
HeightRequest="50" />
Now I updated the Xam.Plugins.Forms.ImageCircle to 2.0.2 and the resulted image is adding below: 现在,我将Xam.Plugins.Forms.ImageCircle更新为2.0.2,结果图像添加如下:
Thanks in advance 提前致谢
It looks as if you are displaying the circles in a ListView
, which has a fixed height of the cells per default. 看起来好像是在
ListView
中显示圆圈,默认情况下,它具有固定高度的单元格。 It seems as if your cells are simply not high enough to give the CircleImage
s the space they need. 似乎您的单元格不够高,无法为
CircleImage
提供CircleImage
的空间。 You have two options to overcome this: 您有两种选择可以解决此问题:
<ListView RowHeight="60" ...>
HasUnevenRows="true"
HasUnevenRows="true"
<ListView HasUnevenRows="true">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.