jamesmontemagno / ImageCirclePlugin

Circle Images for your Xamarin.Forms Applications
MIT License
240 stars 68 forks source link

Border Image Ios Worng #15

Closed brux88 closed 7 years ago

brux88 commented 7 years ago

Please fill out either the bug or feature request section and remove whatever section you are not using.

Bug

hello, I'm using this plugin on Android works perfectly on ios instead the border appears to be related to the width of the view:

<StackLayout Orientation="Vertical"> <StackLayout.HeightRequest> <OnPlatform x:TypeArguments="x:Double" Android="190" iOS="270"></OnPlatform> </StackLayout.HeightRequest> <abstractions:CircleImage Source="{Binding Image}" BorderThickness="3" WidthRequest="100" HeightRequest="100" BorderColor="{StaticResource primaryColor}" Aspect="AspectFit" > </abstractions:CircleImage> <Label Text="bruno Madara" Margin="0,10,0,0" TextColor="White" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" FontAttributes="Bold"></Label> <BoxView HeightRequest="1" Margin="10,0,10,0" HorizontalOptions="Fill" BackgroundColor="Gray" VerticalOptions="End"/> </StackLayout> ![2017-01-11_1803] 20170116_163150

Version Number of Plugin: 1.8.1 Simulator Tested On: iphone 6s 10.2

jamesmontemagno commented 7 years ago

You need to set the width/height the same also probably make the HorizontalAlignment Center

brux88 commented 7 years ago

I set heightrequest and widthrequest the same at 100, I tried to put HorizontalOption = Center, but does not change anything always the same problem

jamesmontemagno commented 7 years ago

The problem is somewhere with your code that you are having the image fill horizontal. If you set the background color you will see. Most likely this could be because your StackLayout is filling horizontally. I would play around with the settings and background colors to see.

This is more of a Xamarin.Forms issue as it shouldn't be filling the width. Clearly it is as the width/height are not 100.

brux88 commented 7 years ago

excuse me I found the error, the problem was that I had skipped the property Vertical? = "FillAndExpand" a stackLayout on Androdi working while on ios gave the problem

jamesmontemagno commented 7 years ago

Yeah, sometimes those are super tricky. Sounds like a Forms bug as they should render the same. I would file at http://bugzilla.xamarin.com

brux88 commented 7 years ago

thanks for your suggestion, (I'm still getting closer now to Xamarin form)

michelviveiros commented 7 years ago

I am having a similar problem, but mine is note with the border, is with the full image, how do I solve this?

jamesmontemagno commented 7 years ago

Can you attach a photo. Most likely your Height/Width Requests are throwing it off.

rafaelrmou commented 7 years ago

@jamesmontemagno when i using relative layout my image get oval format at iOS too; See my snipet:

rlayout.Children.Add(ImageProfile, Constraint.RelativeToParent((parent) => { return (parent.Width / 4); }), Constraint.RelativeToView(GratuitoLabel, (parent, view) => { return view.Y + view.Height + 24; }), Constraint.RelativeToParent((parent) => { return parent.Width .5; //H (the same W) }), Constraint.RelativeToParent((parent) => { return parent.Width .5; //W (the same H) }) );