亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使我的自定義視圖更新編輯器中的文本字段

使我的自定義視圖更新編輯器中的文本字段

手掌心 2021-05-07 15:16:17
因此,即時通訊目前正在處理自定義卡片視圖,我的目標非常簡單。我想將文本字段更新為在自定義卡片視圖xml中設置的字符串。但是,經過數小時的嘗試,以某種方式我無法使它正常工作。有時編輯器不會使用自定義卡片視圖加載我的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文件中設置的屬性值...但是以某種方式,一旦我加載它,編輯器視圖就會崩潰...由于自定義CardView類...沒有真正的錯誤日志...我收到的唯一消息是:渲染布局時預覽超時。當其中一個自定義視圖中存在無限循環或無限遞歸時,通常會發生這種情況我忘了什么?我還能嘗試什么修改編輯器的textview?
查看完整描述

1 回答

?
鴻蒙傳說

TA貢獻1865條經驗 獲得超7個贊

好吧,這很容易...只是添加了一個新的布局活動,該活動將在按下CardView時膨脹。我只是復制CardView元素并將其放置在膨脹視圖內=>問題已解決:)


查看完整回答
反對 回復 2021-05-19
  • 1 回答
  • 0 關注
  • 162 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號