dotnet/maui
GitHub で見るTabbedPage with WidthRequest and/or HeightRequest fails to render
Open
#5,747 opened on 2022年4月1日
area-controls-tabbedpagegood first issueplatform/macoss/triageds/verifiedt/bug
Repository metrics
- Stars
- (23,245 stars)
- PR merge metrics
- (平均マージ 47d 9h) (30d で 248 merged PRs)
説明
Description
If you add a WidthRequest or HeightRequest to a TabbedPage, it does not render correctly.
Without either, it renders as expected:
If you add a WidthRequest, all tabs get crammed into the corner, even if the WidthRequest is wide enough (on iOS, nothing renders):
In addition, the background of the window changes, suggesting a render failure.
If you add a HeightRequest or both, the page becomes blank.
Steps to Reproduce
- Create a new MAUI app
- Change your
MainPage.xaml.csto inherit fromTabbedPage:
namespace MauiTabbedPageBug;
public partial class MainPage : TabbedPage
{
public MainPage()
{
InitializeComponent();
}
}
- Change your
MainPage.xamlto a simple tabbed page:
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiTabbedPageBug.MainPage"
BackgroundColor="{DynamicResource SecondaryColor}"
WidthRequest="640" HeightRequest="480">
<ContentPage Title="My First Tab" />
<ContentPage Title="My Second Tab" />
<ContentPage Title="My Third Tab" />
</TabbedPage>
Remove/add the WidthRequest/HeightRequest attributes.
Version with bug
Preview 14 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
iOS 15.2, macOS 12.3
Did you find any workaround?
No response
Relevant log output
No response