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

Background image on relative layout don't get the screen size on forms

$
0
0

This is the code of the image and layout from a tabbed page:

RelativeLayout PrincipalLayout = new RelativeLayout ();

                    Image background = new Image {
                        Source = Images.Background,
                    };

                    PrincipalLayout.Children.Add (background,
                        xConstraint: Constraint.RelativeToParent ((parent) => {
                            return 0;
                        }),
                        yConstraint: Constraint.RelativeToParent ((parent) => {
                            return 0;
                        }),
                        widthConstraint: Constraint.RelativeToParent ((parent) => {
                            return parent.Width;
                        }),
                        heightConstraint: Constraint.RelativeToParent ((parent) => {
                            return parent.Height;
                        })
                    );
    this.Content = PrincipalLayout;

But the image don't start at X = 0 and don't finish at the right place.

Take a look at the image:

http://i292.photobucket.com/albums/mm15/romuloviel/Captura de Tela 2015-03-18 as 10.06.34_zpsb4cquhtd.png

**I need the image get all frame.
**


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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