使用Android处理程序更改滑块高度.毛伊岛



我正在尝试更改滑块的高度/厚度,以便在Android上进行较少的脚背触摸交互。

我正在使用一个处理程序。

这就是我尝试的:

public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
Microsoft.Maui.Handlers.SliderHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
{
#if ANDROID
// Update slider thickness
handler.PlatformView.LayoutParameters = new Android.Views.ViewGroup.LayoutParams(100, 100);
handler.PlatformView.MinHeight = 100;
handler.PlatformView.SetMinimumHeight(100);
#endif
});
}
}

这些都不起作用。我确信映射器注册正确,因为我成功地尝试了一些更琐碎的情况:

handler.PlatformView.Min = 1;
handler.PlatformView.Max = 100;
handler.PlatformView.Progress = 50; // Set slider progress to 50%

如何更改滑块轨迹条和拇指交互高度?

是的,正如您所说的那样。

我创建了一个关于这个问题的新问题,您可以在这里跟进:https://github.com/dotnet/maui/issues/10259。

感谢您对maui的支持和反馈。

谨致问候。

最新更新