因此,即時通訊目前正在處理自定義卡片視圖,我的目標(biāo)非常簡單。我想將文本字段更新為在自定義卡片視圖xml中設(shè)置的字符串。但是,經(jīng)過數(shù)小時的嘗試,以某種方式我無法使它正常工作。有時編輯器不會使用自定義卡片視圖加載我的xml ...有時它會給我一個非常長的錯誤消息...有時它會保持黑色...因此,我有以下xml文件:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:id="@+id/CallEntry_Holder"android:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical"android:tag="0"><com.test.larsmatthaus.projectnurser.customs.Custom_CardView android:id="@+id/Call_Entry" android:layout_width="match_parent" android:layout_height="50dp" app:cardBackgroundColor="@color/colorCardBackgroundR" app:cardCornerRadius="5dp" app:personName="test" app:room="100" app:ward="test" tools:layout_editor_absoluteX="1024dp"> <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="50dp"> <TextView android:id="@+id/WardName" android:layout_width="0dp" android:layout_height="0dp" android:layout_marginBottom="10dp" android:layout_marginEnd="200dp" android:layout_marginLeft="200dp" android:layout_marginRight="200dp" android:layout_marginStart="200dp" android:layout_marginTop="10dp"它僅包含一個卡視圖條目。我想將TextView“ wardName”更新為我在xml文件中設(shè)置的屬性值...但是以某種方式,一旦我加載它,編輯器視圖就會崩潰...由于自定義CardView類...沒有真正的錯誤日志...我收到的唯一消息是:渲染布局時預(yù)覽超時。當(dāng)其中一個自定義視圖中存在無限循環(huán)或無限遞歸時,通常會發(fā)生這種情況我忘了什么?我還能嘗試什么修改編輯器的textview?
1 回答

鴻蒙傳說
TA貢獻1865條經(jīng)驗 獲得超7個贊
好吧,這很容易...只是添加了一個新的布局活動,該活動將在按下CardView時膨脹。我只是復(fù)制CardView元素并將其放置在膨脹視圖內(nèi)=>問題已解決:)
添加回答
舉報
0/150
提交
取消