国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【錯(cuò)誤記錄】約束布局報(bào)錯(cuò) ( Missing Constraints in ConstraintLayout. This view is not constrained. It only has )

這篇具有很好參考價(jià)值的文章主要介紹了【錯(cuò)誤記錄】約束布局報(bào)錯(cuò) ( Missing Constraints in ConstraintLayout. This view is not constrained. It only has )。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。





一、報(bào)錯(cuò)信息



約束布局中 , 如果不給組件添加約束 , 就會(huì)報(bào)如下錯(cuò)誤 :

Missing Constraints in ConstraintLayout
This view is not constrained. It only has designtime positions, 
so it will jump to (0,0) at runtime unless you add the constraints  
The layout editor allows you to place widgets anywhere on the canvas, 
and it records the current position with designtime attributes (such as layout_editor_absoluteX). 
These attributes are not applied at runtime, so if you push your layout on a device, 
the widgets may appear in a different location than shown in the editor. 
To fix this, make sure a widget has both horizontal and vertical 
constraints by dragging from the edge connections.  
Issue id: MissingConstraints  Vendor: Android Open Source Project Contact: 
https://groups.google.com/g/lint-dev 
Feedback: https://issuetracker.google.com/issues/new?component=192708  

【錯(cuò)誤記錄】約束布局報(bào)錯(cuò) ( Missing Constraints in ConstraintLayout. This view is not constrained. It only has )





二、解決方案




1、手動(dòng)添加約束 ( 推薦 )


Design 界面拖動(dòng)添加約束操作 : 手動(dòng)拖動(dòng) 布局上下左右的 約束按鈕 , 添加約束 ;

【錯(cuò)誤記錄】約束布局報(bào)錯(cuò) ( Missing Constraints in ConstraintLayout. This view is not constrained. It only has )
Code 代碼添加約束 : 在代碼中 , 添加 如下 上下左右的 約束 ;

app:layout_constraintBottom_toTopOf=“@+id/guideline3”
app:layout_constraintEnd_toEndOf=“parent”
app:layout_constraintStart_toStartOf=“parent”
app:layout_constraintTop_toTopOf=“parent”


組件約束完整示例如下 :

    <androidx.fragment.app.FragmentContainerView
        android:id="@+id/fragmentContainerView1"
        android:name="kim.hsl.livedatademo.Fragment1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toTopOf="@+id/guideline3"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

2、自動(dòng)添加約束


使用 Design 面板中的 Infer Constraints 工具 , 可以自動(dòng)為組件添加約束 ;

【錯(cuò)誤記錄】約束布局報(bào)錯(cuò) ( Missing Constraints in ConstraintLayout. This view is not constrained. It only has )文章來源地址http://www.zghlxwxcb.cn/news/detail-480065.html

到了這里,關(guān)于【錯(cuò)誤記錄】約束布局報(bào)錯(cuò) ( Missing Constraints in ConstraintLayout. This view is not constrained. It only has )的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • opencv拉流出現(xiàn)missing picture in access unit with size 4錯(cuò)誤解決

    opencv拉流出現(xiàn)missing picture in access unit with size 4錯(cuò)誤解決

    我們使用opencv作為拉流客戶端,獲取畫面后進(jìn)行圖像處理并推流(使用ffmpeg庫)。 opencv解碼同樣使用ffmpeg庫。 我們要求opencv能根據(jù)業(yè)務(wù)不斷進(jìn)行拉流操作,等效的邏輯代碼如下: 注意代碼中 // 無流時(shí)會(huì)有20-30s超時(shí)時(shí)間 注釋的地方cap.open() 和 cap.read(frame),后面會(huì)用到。 在一

    2024年01月20日
    瀏覽(68)
  • Required request body is missing: 前端接口報(bào)錯(cuò)錯(cuò)誤解決

    Required request body is missing: 前端接口報(bào)錯(cuò)錯(cuò)誤解決

    在前幾天的工作中遇到了一個(gè)小小的問題 這是完整報(bào)錯(cuò): 這個(gè)接口在Apifox上經(jīng)過測(cè)試是沒有問題的,那么因此就是前端接口設(shè)置出了問題。 解決方法: 這個(gè)接口報(bào)錯(cuò)的大意是:必需的請(qǐng)求正文缺失 因此檢查一下接口文檔,發(fā)現(xiàn)數(shù)據(jù)是寫在body里的 因此返回檢查接口代碼,代

    2024年02月15日
    瀏覽(18)
  • 解決Git提交代碼報(bào)錯(cuò): ERROR: commit xxxxx: missing Change-Id in message footer

    解決Git提交代碼報(bào)錯(cuò): ERROR: commit xxxxx: missing Change-Id in message footer

    在近期的工作中完成代碼修改提交代碼時(shí)Git報(bào)錯(cuò)并提示提交不成功,具體錯(cuò)誤如下: ?原因是Change-Id缺失。至于解決方法,Git在報(bào)錯(cuò)時(shí)已經(jīng)提示了,如下圖黃框所示: 首先,復(fù)制命令??gitdir=$(git rev-parse --git-dir); scp -p -P 29418 lijunlin@192.168.64.47:hooks/commit-msg ${gitdir}/hooks/ 并執(zhí)行

    2024年02月05日
    瀏覽(22)
  • 創(chuàng)建vue項(xiàng)目的時(shí)候報(bào)錯(cuò):Skipped git commit due to missing username and email in git config.

    創(chuàng)建vue項(xiàng)目的時(shí)候報(bào)錯(cuò):Skipped git commit due to missing username and email in git config.

    git 進(jìn)行初始化提交 沒有綁定 對(duì)應(yīng)的 git用戶名和郵箱 終端進(jìn)行配置 以此進(jìn)行輸入即可 只要不報(bào)錯(cuò)就沒有問題 git config --global user.name \\\"xxxx\\\" git config --global user.email \\\"xxxx\\\" 配置完成后進(jìn)行查看 查看配置的用戶名: git config user.name 查看配置的郵箱名: git config user.email

    2024年02月12日
    瀏覽(18)
  • Vivado報(bào)錯(cuò):[Opt 31-67] Problem: A LUT6 cell in the design is missing a connection on input pin I5

    Vivado報(bào)錯(cuò):[Opt 31-67] Problem: A LUT6 cell in the design is missing a connection on input pin I5

    具體報(bào)錯(cuò)內(nèi)容如下: [Opt 31-67] Problem: A LUT6 cell in the design is missing a connection on input pin I5, which is used by the LUT equation. This pin has either been left unconnected in the design or the connection was removed due to the trimming of unused logic. The LUT cell name is: design_1_i/pingpang_write_buff_0/inst/FSM_sequential_ram_wr_stat

    2023年04月24日
    瀏覽(80)
  • 錯(cuò)誤記錄:Unknown column ‘xxx‘ in ‘where clause‘

    錯(cuò)誤記錄:Unknown column ‘xxx‘ in ‘where clause‘

    這個(gè)錯(cuò)誤意思是沒有找到where分句中的字段名,個(gè)人總結(jié)存在三種錯(cuò)誤情況。判斷錯(cuò)誤方式可以直接在數(shù)據(jù)庫運(yùn)行語句,進(jìn)一步判斷是代碼問題還是表格問題。 注意在一些sql版本中,字符串只能用雙引號(hào)包裹。測(cè)試是否是這個(gè)錯(cuò)誤很簡單,直接在數(shù)據(jù)庫中運(yùn)行語句即可。 如果

    2024年02月11日
    瀏覽(19)
  • 【錯(cuò)誤記錄】Uncaught SyntaxError: Not available in legacy mode

    【錯(cuò)誤記錄】Uncaught SyntaxError: Not available in legacy mode

    錯(cuò)誤記錄 :Uncaught SyntaxError: Not available in legacy mode 錯(cuò)誤描述 :在vite腳手架項(xiàng)目當(dāng)中,使用vue-i18n插件進(jìn)行國際化多語言時(shí),報(bào)錯(cuò) 解決方案 : 在引入vue-i18n 處,添加 legacy: false 如果對(duì)項(xiàng)目不熟悉,可以在全局下搜索createI18n 再添加 ? ?

    2024年02月13日
    瀏覽(27)
  • Android4:約束布局

    Android4:約束布局

    創(chuàng)建項(xiàng)目 My Constraint Layout 一般創(chuàng)建項(xiàng)目之后 activity_main.xml 文件默認(rèn)就是采用約束布局,如: 這里先把默認(rèn)的刪除 TextView 掉,切換到 Design 模式 使用約束將Button處于水平居中和垂直居中 對(duì)應(yīng)的 Code 多個(gè)視圖之間進(jìn)行約束 添加另一個(gè)按鈕button4,鼠標(biāo)拖動(dòng)button4的空心圓連接到

    2024年02月12日
    瀏覽(22)
  • Android約束布局

    一、 嵌套布局效率可能很低。 在 Android 開發(fā)中,我們常常需要使用嵌套布局來實(shí)現(xiàn)某些較復(fù)雜的界面效果。但是嵌套層級(jí)太深會(huì)帶來一些問題,主要包括: 視圖層級(jí)過深,導(dǎo)致內(nèi)存占用過高和性能下降。Android 需要為每個(gè) View 對(duì)象分配內(nèi)存,嵌套層級(jí)過深會(huì)創(chuàng)建很多 View 對(duì)象,占用

    2024年02月07日
    瀏覽(16)
  • IDEA報(bào)錯(cuò):無法自動(dòng)裝配。找不到 ‘xxxService‘ 類型的 Bean?!惧e(cuò)誤記錄】

    IDEA報(bào)錯(cuò):無法自動(dòng)裝配。找不到 ‘xxxService‘ 類型的 Bean?!惧e(cuò)誤記錄】

    這個(gè)問題卡了兩天,deptService一直報(bào)紅,現(xiàn)在終于解決了 ?原因:在給Application添加scanBasePackages屬性時(shí)寫到了放Conteoller層的controller文件內(nèi),而Service層文件都在此文件夾之外導(dǎo)致無法掃描到service類型的bean ?解決方法: 在application里加上三層架構(gòu)文件夾所在的文件夾 ? ?已不報(bào)

    2024年02月11日
    瀏覽(18)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包