前言:開(kāi)發(fā)的時(shí)候發(fā)現(xiàn)一些運(yùn)行到手機(jī)里的dialog顯示不全,只顯示一半左右
?問(wèn)了下chatgpt發(fā)現(xiàn)沒(méi)有任何頭緒,于是開(kāi)始自己慢慢分析
顯示去掉了原有的dialog的style發(fā)現(xiàn)問(wèn)題解決了,但在原有基礎(chǔ)上如何解決呢?
先看看xml,發(fā)現(xiàn)設(shè)置了寬高都不起作用
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/d2uc_dimen_1200"
android:layout_height="@dimen/dialog_agreement_height"
android:id="@+id/dialog_agreement_container"
android:layout_marginTop="@dimen/d2uc_dimen_47"
android:layout_marginStart="@dimen/d2uc_dimen_48"
android:layout_marginBottom="@dimen/d2uc_dimen_48"
android:background="@drawable/card_high_expand"
android:padding="@dimen/card_high_expand_stroke"
android:orientation="vertical">
....
</LinearLayout>
使用LayoutInspector查看發(fā)現(xiàn)其寬高都特別小
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-817930.html
嘗試把windows的寬度和高度設(shè)置為最大后發(fā)現(xiàn)問(wèn)題解決了!?。?!所以特此記錄一下,這個(gè)問(wèn)題花了我一二個(gè)小時(shí)折騰,macBookPro太老了原來(lái)越慢8G內(nèi)存完全不夠用?。。?span toymoban-style="hidden">文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-817930.html
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
到了這里,關(guān)于A(yíng)ndroid Dialog 顯示不全的問(wèn)題的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!