“标签在使用Sharpnado Tabs (.NET MAUI)时不可见”

huangapple go评论77阅读模式
英文:

Label in the tab is not visible using Sharpnado Tabs (.NET MAUI)

问题

我无法在每个UnderlinedTabItem中看到标签。当我将UnderlinedTabItem更改为BottomTabItem时,应用程序会自动适应新的TabItem,然后我可以看到标签。但是当我刷新应用程序时,我再也看不到文本了。然后,当我将BottomTabItem更改为UnderlinedTabItem时,文本再次出现。但是,当我离开应用程序并再次登录时,除非我手动更改代码并在UnderlinedTabItem和BottomTabItem之间切换,否则我看不到文本。所有TabItem都像SegmentedTabItem一样工作。我甚至尝试使用Android模拟器,但效果一样。

这是当我刚开始启动应用程序时的样子。

然后下面的图片是当我将UnderlinedTabItem更改为BottomTabItem时的样子。它会自动更改并显示标签。

然后,如果我将BottomTabItem更改为UnderlinedTabItem,它就会像下面这样正常工作。

但是当我退出应用程序并再次运行时,它会消失并恢复到第一张图片的样子。

英文:

I can't see the label in each UnderlinedTabItem. When I change UnderlinedTabItem to BottomTabItem, then the app automatically adapts the new TabItem and then I can see the label. But when I refresh the app I can't see the text again. Then when I change BottomTabItem to UnderlinedTabItem, the text appears again. But again, when I leave the app and log in again, I can't see the text unless I manually change the code and switch between UnderlinedTabItem and BottomTabItem. All TabItem works like that like SegmentedTabItem does the same thing. I even tried with an Android Emulator but it does the same thing.

<tabs:TabHostView Grid.Row="1" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}" Margin="0,10,0,0">
            <tabs:UnderlinedTabItem Label="1" SelectedTabColor="#ffca73" UnselectedLabelColor="Gray" BackgroundColor="white"/>
            <tabs:UnderlinedTabItem Label="2" SelectedTabColor="#ffca73" UnselectedLabelColor="Gray" BackgroundColor="white"/>
            <tabs:UnderlinedTabItem Label="3" SelectedTabColor="#ffca73" UnselectedLabelColor="Gray" BackgroundColor="white"/>
</tabs:TabHostView>

This is what it looks like when I just start the app.
“标签在使用Sharpnado Tabs (.NET MAUI)时不可见”

Then below picture is what it looks like when I change UnderlinedTabItem to BottomTabItem. It changes automatically and shows the label.
“标签在使用Sharpnado Tabs (.NET MAUI)时不可见”

Then if I change BottomTabItem to UnderlinedTabItem it works well like below.
“标签在使用Sharpnado Tabs (.NET MAUI)时不可见”

But then when I get out of the app and run it again, it disappears and goes back to the first picture.
“标签在使用Sharpnado Tabs (.NET MAUI)时不可见”

答案1

得分: 2

我刚刚制作了一个演示,并发现了类似的问题。

然后我移除了背景颜色或设置背景颜色为"Transparent",然后它可以显示:

<tabs:UnderlinedTabItem Label="3" SelectedTabColor="#ffca73" UnselectedLabelColor="Gray" BackgroundColor="Transparent"/>

或者

<tabs:UnderlinedTabItem Label="3" SelectedTabColor="#ffca73" UnselectedLabelColor="Gray" />

希望对你有帮助!

英文:

I have just made a demo and found the similar issue.

And then I remove the Background color or set the BackgroundColor="Transparent", then it can show:

&lt;tabs:UnderlinedTabItem Label=&quot;3&quot; SelectedTabColor=&quot;#ffca73&quot; UnselectedLabelColor=&quot;Gray&quot; BackgroundColor=&quot;Transparent&quot;/&gt;

or

&lt;tabs:UnderlinedTabItem Label=&quot;3&quot; SelectedTabColor=&quot;#ffca73&quot; UnselectedLabelColor=&quot;Gray&quot; /&gt;

Hope it helps!

huangapple
  • 本文由 发表于 2023年6月21日 23:00:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/76524690.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定