goldze / MVVMHabit

👕基于谷歌最新AAC架构,MVVM设计模式的一套快速开发库,整合Okhttp+RxJava+Retrofit+Glide等主流模块,满足日常开发需求。使用该框架可以快速开发一个高质量、易维护的Android应用。
Apache License 2.0
7.6k stars 1.69k forks source link

页面值不更新 #87

Closed codeceo-net closed 3 years ago

codeceo-net commented 3 years ago

package com.reagent.www.ui.user;

import android.os.Bundle;

import androidx.annotation.Nullable; import androidx.databinding.ViewDataBinding; import androidx.lifecycle.ViewModelProviders;

import com.reagent.www.BR; import com.reagent.www.R; import com.reagent.www.app.AppViewModelFactory; import com.reagent.www.data.BaseRepository; import com.reagent.www.databinding.ActivityUserBinding; import com.reagent.www.ui.xpopup.XpopupViewModel; import com.spd.base.mvvm.base.BaseActivity; import com.spd.base.mvvm.base.BaseViewModel;

/**

package com.reagent.www.ui.user;

import android.app.Application;

import androidx.annotation.NonNull; import androidx.databinding.ObservableField;

import com.reagent.www.data.BaseRepository; import com.spd.base.mvvm.base.BaseViewModel;

/**

<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:binding="http://schemas.android.com/apk/res-auto">

<androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorPrimary">

    <TextView
        android:id="@+id/tv_sex"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@{user.titles}"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

代码如上 但是页面上的值为什么更新不了,对比其他页面没有错误呀,就是不更新