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

Adding tabs to the screen without using Tabbed pages?

$
0
0

Hi

I want to have two buttons at the bottom of my app which take up 50% of the width each. Basically the same as the tabbed page layout but I don't want a new page to be shown when the user clicks the tab...

The code I have at the moment uses a relative layout:

var layout = new RelativeLayout();
layout.Children.Add (takePhotosButton,
Constraint.RelativeToView (layout, (parent, sibling) => {
return (parent.Width / 2) - takePhotosButton.Width;
}),
Constraint.RelativeToParent ((parent) => {
return parent.Height - 70;
}));
layout.Children.Add (notesButton,
Constraint.RelativeToView (takePhotosButton, (parent, sibling) => {
return sibling.X + sibling.Width + 3;
}),
Constraint.RelativeToParent ((parent) => {
return parent.Height - 70;
}));

This seems to work sometimes but other times the buttons start 3/4 of the way on the screen:

Is this a bug in relative layout?

Is there a tab control or something I can use?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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