简体   繁体   English

Xamarin Android应用程序(Visual Studio)中的ListView分隔线不可见

[英]ListView divider line in Xamarin Android app (Visual Studio) is not visible

The ListView divider is not visible in my Android Xamarin app (Visual Studio). ListView分隔符在我的Android Xamarin应用程序(Visual Studio)中不可见。 Unfortunately this solution is not working. 不幸的是, 这个解决方案无效。

Here is my theme.xml: 这是我的theme.xml:

  <?xml version="1.0" encoding="utf-8"?>
<resources>
  <color name="bg">#ffffff</color>
  <style name="MyTheme">
    <item name="android:colorAccent">#000000</item>
    <item name="android:colorPrimary">#ff2f4453</item>
    <item name="android:colorPrimaryDark">#000000</item>
    <item name="android:colorButtonNormal">#ff527791</item>
    <item name="android:navigationBarColor">#ff527791</item>
    <item name="android:textColorPrimary">#ff000000</item>
    <item name="android:textColorSecondary">#ffffffff</item>
    <item name="android:colorActivatedHighlight">#000000</item>
    <item name="android:divider">#B6B6B6</item>
    <item name="android:dividerHeight">1px</item>
    <item name="android:windowBackground">@color/bg</item>
  </style>
</resources>

and here the Main.xml from the activity with the ListView-Control: 这里是ListView-Control活动的Main.xml:

<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:p1="http://schemas.android.com/apk/res/android"
    p1:minWidth="25px"
    p1:minHeight="25px"
    p1:layout_width="match_parent"
    p1:layout_height="match_parent"
    p1:id="@+id/usersList">
</ListView>

When i change the theme to one of the defaults, the divider is shown correctly, but when i use my own theme, it's no more visible. 当我将主题更改为其中一个默认值时,分隔符会正确显示,但是当我使用自己的主题时,它就不再可见了。

Did i forgot something to add in the colors? 我忘记了添加颜色的东西吗?

Thanks in Advance! 提前致谢!

尝试这个:

android:dividerHeight="5dp"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM