the49ltd / The49.Maui.BottomSheet

.NET MAUI library used to display pages as Bottom Sheets
MIT License
331 stars 34 forks source link

Handle not being shown. #116

Open danleash opened 6 months ago

danleash commented 6 months ago

Hello, I'm trying to integrate bottom sheet into my application. I am setting the values HasHandle to true however, it is not being shown. Tried:

var page = new BottomSheetElement(); page.HasHandle = true; page.HandleColor = Colors.Salmon;

        And also:
        <the49:BottomSheet xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               x:Class="Siege.Client.Mobile.BottomSheetElement"
               xmlns:the49="https://schemas.the49.com/dotnet/2023/maui"
               xmlns:mobile="clr-namespace:Siege.Client.Mobile"
               Padding="16, 32" BackgroundColor="#0F0F0F" HandleColor="Azure" HasHandle="True" Shadow="">
<the49:BottomSheet.Detents>
    <the49:MediumDetent></the49:MediumDetent>
</the49:BottomSheet.Detents>
<VerticalStackLayout>
    <Label
        Text="Test Bottomsheet" VerticalOptions="Center" HorizontalOptions="Center" TextColor="Azure"/>
    <!-- <BoxView Style="{StaticResource Divider}" x:Name="divider" /> -->
</VerticalStackLayout>

</the49:BottomSheet>

Any ideas what would cause HasHandle not to work?

FroggieFrog commented 6 months ago

Check this section of the ReadMe and this video.

kaykaykim commented 4 months ago

Create a file Platform/Android/Resources/values/styles.xml file in the github readme file. the handler will show up

MarcAlx commented 4 months ago

Create a file Platform/Android/Resources/values/styles.xml file in the github readme file. the handler will show up

What you have to do is to follow this section of the README.md

On Android, make sure your application's theme extends the Material3 theme. This mean you need a Platforms/Android/Resources/values/styles.xml file with the following content:

<?xml version="1.0" encoding="utf-8" ?>
<resources>
    <style name="Maui.MainTheme" parent="Theme.Material3.DayNight"></style>
</resources>

If you already have this file, just make sure the Maui.MainTheme style inherits the Theme.Material3.DayNight parent.

With this the handle finally shows in my Android app.