Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Customer Renderer View Dimensions

$
0
0

Hi All,

I'm currently writing a custom renderer, in order to display a video control on a ContentPage.

The basics of the player are working - however, I'm unable to find any documentation/guidance on how I should set the size of my custom view. A majority of the help seems to be around doing things like adding support for rounded corners or borders to existing renders, rather than creating entirely new views.

My problem is that the aspect-ratio of the video is not being respected, and the WidthRequest property is being ignored. I'm able to set a custom height, but this results in distorted video.

I can see that the class ViewRenderer<TView, TNativeView> has a method called GetDesiredSize(int widthConstraint, int heightConstraint) - I'm assuming that I'll have to use this some-how? The Native control (an Android VideoView) has SetMinimumWidth(int minWidth) and SetMinimumHeight(int minHeight) methods, but the Width and Height properties are read-only.

I'm currently focusing on the Android Renderer.

Can anyone offer any advice?

Many thanks.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>