英文:
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.
Then below picture is what it looks like when I change UnderlinedTabItem
to BottomTabItem. It changes automatically and shows the label.
Then if I change BottomTabItem
to UnderlinedTabItem
it works well like below.
But then when I get out of the app and run it again, it disappears and goes back to the first picture.
答案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:
<tabs:UnderlinedTabItem Label="3" SelectedTabColor="#ffca73" UnselectedLabelColor="Gray" BackgroundColor="Transparent"/>
or
<tabs:UnderlinedTabItem Label="3" SelectedTabColor="#ffca73" UnselectedLabelColor="Gray" />
Hope it helps!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论