Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

MaterialButton TextColor style position problem

Đang mở
#420 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
28/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
mobile-dev

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện trường hợp Android Xamarin.Forms với kiểu ContentPage.Resources được báo cáo và cả hai thứ tự Setter. Theo dõi cách MaterialButton xử lý các thuộc tính kiểu TextColor và ButtonType, sau đó xác minh rằng TextColor vẫn là White bất kể thứ tự của Setter.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

🐛 Bug Report

I don't know about other cases, but if I set "TextColor" property before "ButtonType" property in my style declaration - the text color is not applied.

Expected behavior

The "TextColor" property has to be applied independently of the position in the style declaration.

Reproduction steps
  1. Create a simple ContentPage:
<ContentPage ...>
  <ContentPage.Resources>
    <ResourceDictionary>
      <Style TargetType="material:MaterialButton" x:Key="MaterialButtonStyle">
        <Setter Property="TextColor" Value="White" />
        <Setter Property="ButtonType" Value="Outlined" />
      </Style>
    </ResourceDictionary>
  </ContentPage.Resources>
  <StackLayout Orientation="Horizontal">
      <material:MaterialButton Style="{StaticResource MaterialButtonStyle}" Text="Apply" />
      <material:MaterialButton Style="{StaticResource MaterialButtonStyle}" Text="Ok" />
  </StackLayout>
</ContentPage>
  1. Notice the text color is not white:

image

  1. Swap "TextColor" and "ButtonType" properties and notice the color is applied now:
<Style TargetType="material:MaterialButton" x:Key="MaterialButtonStyle">
  <Setter Property="ButtonType" Value="Outlined" />
  <Setter Property="TextColor" Value="White" />
</Style>

image

Configuration

Version: 1.7.8

Platform:

  • 📱 iOS
  • 🤖 Android
  • 🏁 WPF
  • 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • 🐒 Xamarin.Forms
Ngôn ngữ chính
C#
Star
630
Fork
149
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Baseflow/XF-Material-Library

Tất cả issue của Baseflow/XF-Material-Library

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.