Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

MaterialButton TextColor style position problem

オープン
#420 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
28/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
csharp
領域
mobile-dev

調査の方向性

報告されている ContentPage.Resources スタイルと両方の Setter の順序を使って、まず Android Xamarin.Forms のケースを再現します。MaterialButton によるスタイルプロパティ TextColor と ButtonType の処理を追跡し、その後、Setter の順序にかかわらず TextColor が White のままであることを確認します。

索引モデルが issue の本文から書いたものです。

説明

🐛 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
主要言語
C#
スター
631
フォーク
150
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Baseflow/XF-Material-Library のほかの issue

Baseflow/XF-Material-Library の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。