question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting unexpected gradient background with partly rounded corners

See original GitHub issue

Describe the bug

I get an unexpected gradient brush when only some corners of a panel are rounded.

Steps to reproduce the bug

  1. Use Windows App SDK 1.0 Preview 3
  2. Add a panel with a background and with only two rounded corners

When using this XAML:

<Border Background="Red" CornerRadius="30,0,0,30"/>

I get this result:

image

Expected behavior

The panel should have a solid background color

Screenshots

image

NuGet package version

WinUI 3 - Windows App SDK 1.0 Preview 3

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

May 2021 Update (19043)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gabbybilkacommented, Apr 19, 2022
0reactions
WelterDevelopmentcommented, Jan 2, 2022

For people who stumble over this and need a quick way to remove the gradient in the TabViewItemHeader, just add this to App.xaml:

<CornerRadius x:Key="OverlayCornerRadius">0</CornerRadius>

The TabViewItemHeader now looks super ugly but its better than the weird color gradient. Then manually set the CornerRadius for every control that you want to have rounded corners:

<CornerRadius x:Key="CornerRadius">4</CornerRadius>
<CornerRadius x:Key="LargeCornerRadius">8</CornerRadius>

<Style  TargetType="FlyoutPresenter" >
  <Setter Property="CornerRadius" Value="{StaticResource LargeCornerRadius}"></Setter>
</Style>
<Style  TargetType="Button" >
  <Setter Property="CornerRadius" Value="{StaticResource CornerRadius}"></Setter>
</Style>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Linear Gradient with Round corners - css
I am creating a background image using linear gradients. How to to add round corners for each linear gradient.
Read more >
<gradient> - CSS: Cascading Style Sheets - MDN Web Docs
Chrome Edge Full support. Chrome26. more. Toggle history Full support. Edg... conic‑gradient() Full support. Chrome69. Toggle history Full support. Edg... Double‑position color stops Full support. Chrome72....
Read more >
border-top-left-radius - CSS: Cascading Style Sheets | MDN
The border-top-left-radius CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major ...
Read more >
Applying CSS rounded corners to gradients???
background-image : -webkit-gradient(linear, left top, right top, ... I want to apply rounded corners to the top two corners of this gradient, ...
Read more >
A Farewell to CSS3 Gradients
Read A Farewell to CSS3 Gradients and learn with SitePoint. ... how easily we now conjure up rounded corners, shadows, and object rotations....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found