Skip to content

Commit

Permalink
Fixing Symbol Display sample (#606)
Browse files Browse the repository at this point in the history
* Switch cancelButton image to FontImageSource allowing for more flexible and scalable icon usage (#593)

* Switch cancelButton image to FontImageSource allowing for more flexible and scalable icon usage with support for Dark/Light mode fixes.

* Update cancelButton icon color to #6E6E6E
Removed unused resources.

* Add platform-specific min size for SymbolDisplay on Android to fix issue with Pixel 4 rendering.

* Reverting changing height and width and removing Border to resolve the issue

* Fixing SymbolDisplay on Android Pixel 4 device by removing Border element
  • Loading branch information
prathameshnarkhede authored Sep 20, 2024
1 parent 34a3607 commit 675720e
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,14 @@ private void AddSymbol(Symbol symbol)
{
int columnCount = LayoutRoot.ColumnDefinitions.Count;
var sd = new SymbolDisplay() { Symbol = symbol };
Border border = new Border()
{
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Padding = 0,
StrokeThickness = 1,
};
border.SetAppThemeColor(Microsoft.Maui.Controls.Border.StrokeProperty, Colors.Black, Colors.White);
border.Content = sd;
int count = LayoutRoot.Children.Count;
var row = count / columnCount;
var column = count % columnCount;
if (column == 0)
LayoutRoot.RowDefinitions.Add(new RowDefinition());
Grid.SetRow(border, row);
Grid.SetColumn(border, column);
LayoutRoot.Children.Add(border);
Grid.SetRow(sd, row);
Grid.SetColumn(sd, column);
LayoutRoot.Children.Add(sd);
}
}
}

0 comments on commit 675720e

Please sign in to comment.