Hi Bharathiraja,
The following code will split up two editors so that both of them are exactly 50% of the height of the screen. This however I cannot achieve with the
SFTextInputLayout and shown by the lower screen shot and code attempts.
The main problem is the "ViewControl" cannot be sized inside the Input Control with out setting the ViewControls height explicitly.. E.g HeightRequest = 400.
Set the main views content to mainLayout (E.g, this.Content = mainLayout)
AbsoluteLayout mainLayout = new AbsoluteLayout()
{
VerticalOptions = new LayoutOptions(LayoutAlignment.Fill, true),
HorizontalOptions = new LayoutOptions(LayoutAlignment.Fill, true),
BackgroundColor = Color.Red
};
Editor _top = new Editor()
{
BackgroundColor = Color.Blue
};
AbsoluteLayout.SetLayoutBounds(_top, new Rectangle(0, 0, 1, .5));
AbsoluteLayout.SetLayoutFlags(_top, AbsoluteLayoutFlags.All);
Editor _bottom = new Editor()
{
BackgroundColor = Color.Yellow
};
AbsoluteLayout.SetLayoutBounds(_bottom, new Rectangle(1, 1, 1, .5));
AbsoluteLayout.SetLayoutFlags(_bottom, AbsoluteLayoutFlags.All);
mainLayout.Children.Add(_top);
mainLayout.Children.Add(_bottom);
Attempt 1 - Setting the size of the Sf Input
AbsoluteLayout mainLayout = new AbsoluteLayout()
{
VerticalOptions = new LayoutOptions(LayoutAlignment.Fill, true),
HorizontalOptions = new LayoutOptions(LayoutAlignment.Fill, true),
BackgroundColor = Color.Red
};
SfTextInputLayout sfInput = new SfTextInputLayout() {
BackgroundColor = Color.Pink
};
Editor _top = new Editor()
{
BackgroundColor = Color.Blue,
VerticalOptions = LayoutOptions.FillAndExpand, // Also teh same with out the Vertical and Horizontal options set
HorizontalOptions = LayoutOptions.FillAndExpand
};
sfInput.InputView = _top;
AbsoluteLayout.SetLayoutBounds(sfInput, new Rectangle(0, 0, 1, .5));
AbsoluteLayout.SetLayoutFlags(sfInput, AbsoluteLayoutFlags.All);
Editor _bottom = new Editor()
{
BackgroundColor = Color.Yellow
};
AbsoluteLayout.SetLayoutBounds(_bottom, new Rectangle(1, 1, 1, .5));
AbsoluteLayout.SetLayoutFlags(_bottom, AbsoluteLayoutFlags.All);
mainLayout.Children.Add(sfInput);
mainLayout.Children.Add(_bottom);
Attempt 2 - Setting the height of the editor control used as the SF Input View Control
AbsoluteLayout mainLayout = new AbsoluteLayout()
{
VerticalOptions = new LayoutOptions(LayoutAlignment.Fill, true),
HorizontalOptions = new LayoutOptions(LayoutAlignment.Fill, true),
BackgroundColor = Color.Red
};
SfTextInputLayout sfInput = new SfTextInputLayout() {
BackgroundColor = Color.Pink
};
Editor _top = new Editor()
{
BackgroundColor = Color.Blue,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand
};
sfInput.InputView = _top;
AbsoluteLayout.SetLayoutBounds(_top, new Rectangle(0, 0, 1, .5));
AbsoluteLayout.SetLayoutFlags(_top, AbsoluteLayoutFlags.All);
Editor _bottom = new Editor()
{
BackgroundColor = Color.Yellow
};
AbsoluteLayout.SetLayoutBounds(_bottom, new Rectangle(1, 1, 1, .5));
AbsoluteLayout.SetLayoutFlags(_bottom, AbsoluteLayoutFlags.All);
mainLayout.Children.Add(sfInput);
mainLayout.Children.Add(_bottom);
Attempt 3 - Setting bothjthe SF Input and the Editors heights.
AbsoluteLayout mainLayout = new AbsoluteLayout()
{
VerticalOptions = new LayoutOptions(LayoutAlignment.Fill, true),
HorizontalOptions = new LayoutOptions(LayoutAlignment.Fill, true),
BackgroundColor = Color.Red
};
SfTextInputLayout sfInput = new SfTextInputLayout() {
BackgroundColor = Color.Pink
};
Editor _top = new Editor()
{
BackgroundColor = Color.Blue,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand
};
sfInput.InputView = _top;
AbsoluteLayout.SetLayoutBounds(sfInput, new Rectangle(0, 0, 1, .5));
AbsoluteLayout.SetLayoutFlags(sfInput, AbsoluteLayoutFlags.All);
AbsoluteLayout.SetLayoutBounds(_top, new Rectangle(0, 0, 1, .5));
AbsoluteLayout.SetLayoutFlags(_top, AbsoluteLayoutFlags.All);
Editor _bottom = new Editor()
{
BackgroundColor = Color.Yellow
};
AbsoluteLayout.SetLayoutBounds(_bottom, new Rectangle(1, 1, 1, .5));
AbsoluteLayout.SetLayoutFlags(_bottom, AbsoluteLayoutFlags.All);
mainLayout.Children.Add(sfInput);
mainLayout.Children.Add(_bottom);