-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Padding for iOS Buttons in some scenarios (#24760)
* Add padding for buttons that need it and UITest * lost some spaces in the xaml * android and windows screenshot
- Loading branch information
1 parent
9648523
commit 60076be
Showing
7 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+150 KB
...ts/TestCases.Android.Tests/snapshots/android/ButtonPaddingIsAddedWhenNeeded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions
40
src/Controls/tests/TestCases.HostApp/Issues/Issue24746.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue24746" | ||
Title="Issue24746"> | ||
<VerticalStackLayout> | ||
<HorizontalStackLayout> | ||
<Button Text="Hello, longer world!" ImageSource="dotnet_bot_resized2.png" | ||
Background="lightgray" ContentLayout="Top,0" AutomationId="TopButton"/> | ||
</HorizontalStackLayout> | ||
|
||
<HorizontalStackLayout> | ||
<Button Text="Hello, longer world!" ImageSource="dotnet_bot_resized2.png" | ||
Background="lightgreen" ContentLayout="Top,0" Padding="0" /> | ||
</HorizontalStackLayout> | ||
|
||
<HorizontalStackLayout> | ||
<Button Text="Hello, longer world!" ImageSource="dotnet_bot_resized2.png" | ||
Background="lightblue" ContentLayout="Top,0" Padding="5" /> | ||
</HorizontalStackLayout> | ||
|
||
<HorizontalStackLayout> | ||
<Button Text="Hello, longer world!" ImageSource="dotnet_bot_resized2.png" | ||
Background="purple" ContentLayout="Top,0" Padding="50,10" /> | ||
</HorizontalStackLayout> | ||
|
||
<Button Text="Hello, longer world!" ImageSource="dotnet_bot_resized2.png" | ||
Background="lightgray" ContentLayout="Top,0" HorizontalOptions="Center" /> | ||
|
||
<Button Text="Hello, longer world!" ImageSource="dotnet_bot_resized2.png" Padding="0" | ||
Background="lightgreen" ContentLayout="Top,0" HorizontalOptions="Center" /> | ||
|
||
<Button Text="Hello, longer world!" ImageSource="dotnet_bot_resized2.png" Padding="5" | ||
Background="lightblue" ContentLayout="Top,0" HorizontalOptions="Center" /> | ||
|
||
<Button Text="Hello, longer world!" ImageSource="dotnet_bot_resized2.png" Padding="50,10" | ||
Background="purple" ContentLayout="Top,0" HorizontalOptions="Center" /> | ||
|
||
</VerticalStackLayout> | ||
</ContentPage> |
11 changes: 11 additions & 0 deletions
11
src/Controls/tests/TestCases.HostApp/Issues/Issue24746.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 24746, "iOS button padding is increased if needed", PlatformAffected.All)] | ||
public partial class Issue24746 : ContentPage | ||
{ | ||
public Issue24746() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24746.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue24746 : _IssuesUITest | ||
{ | ||
public Issue24746(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "iOS button padding is increased if needed"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Button)] | ||
public void ButtonPaddingIsAddedWhenNeeded() | ||
{ | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Binary file added
BIN
+35 KB
...ests/TestCases.WinUI.Tests/snapshots/windows/ButtonPaddingIsAddedWhenNeeded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+181 KB
...rols/tests/TestCases.iOS.Tests/snapshots/ios/ButtonPaddingIsAddedWhenNeeded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.