0

尝试在 Xamarin 应用程序中使用 Pixate 和 MvvmCross 设置按钮样式。类选择器似乎不起作用。可以看到主按钮类没有设置字体颜色为黄色且按钮背景不是蓝色

有没有人使用 pixate 和 MvvmCross 并找到了解决这个问题的方法?

默认的.css

button {
    font-size: 30px;
    border-radius: 15px;
    border-width: 2px;
    border-color: lightgray;

}

/* Cannot seem to get class selector to work with mvvm cross */
.mainbutton {
    color: yellow;
    background-color: blue;
}

主文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:minWidth="25px"
    android:minHeight="25px">
    <Button
        android:text="Test One"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        class="mainbutton"
        local:MvxBind="Click CommandOne" />
</LinearLayout>

在此处输入图像描述

4

0 回答 0