首页 新闻 赞助 找找看

安卓车机软件在车机上只显示一半

0
悬赏园豆:200 [已解决问题] 解决于 2023-12-16 01:44

在车机上安装酷我音乐车机版只显示一半,
弹窗倒是正常显示,
只有主界面只显示在右边,
车机是安卓5.1系统,分辨率1280*480 ,
软件是酷我车机版6.0,之前5.0版本无此问题。
请教是修改哪里的代码可以全屏显示?
致谢~

附上 activity_main文件
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="-1"
android:layout_height="-1"
android:layout_marginLeft="@7F0600C9"
>
<androidx.fragment.app.FragmentContainerView
android:name="cn.kuwo.base.uilib.kwnavigation.KwNavHostFragment"
android:id="@7F080233"
android:layout_width="0.0dip"
android:layout_height="0.0dip"
app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="0"
app:layout_constraintLeft_toLeftOf="0"
app:layout_constraintRight_toRightOf="0"
app:layout_constraintTop_toTopOf="0"
app:navGraph="@7F0D0001"
>
</androidx.fragment.app.FragmentContainerView>
<LinearLayout
android:gravity="0x00000010"
android:orientation="0"
android:id="@7F0801DE"
android:background="@7F070289"
android:paddingLeft="@7F0602BA"
android:paddingRight="@7F0602BA"
android:visibility="2"
android:layout_width="-2"
android:layout_height="@7F06041E"
android:layout_marginTop="@7F0601FF"
app:layout_constraintEnd_toEndOf="0"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="0"
app:layout_constraintTop_toTopOf="0"
>
<ImageView
android:id="@7F080153"
android:layout_width="@7F060340"
android:layout_height="@7F060340"
android:layout_marginRight="@7F0601F3"
android:src="@7F0702C1"
>
</ImageView>
<TextView
android:textColor="@7F05010F"
android:id="@7F080338"
android:layout_width="-2"
android:layout_height="-2"
android:text="数专辑专辑群益"
>
</TextView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

乔利的主页 乔利 | 初学一级 | 园豆:22
提问于:2022-10-13 13:16
< >
分享
最佳答案
1

从你的代码看来,你在ConstraintLayout中使用的宽度和高度都是"-1",这可能导致了只显示一半的问题。你可以尝试将宽度和高度改为"match_parent"来全屏显示:

<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@7F0600C9"
>

另外,你的FragmentContainerViewLinearLayout的宽度也被设置为了"0.0dip",这可能会导致他们不显示。你可以尝试将他们的宽度改为"match_parent"或者具体的dp值。

同时,注意检查资源文件是否正确,以及id对应的布局或者控件是否存在。如果以上修改还是无法解决问题,建议你可以检查你的AndroidManifest.xml文件,看看Activity声明时有无特殊设置,如固定的横屏、竖屏设置,或者全屏设置等。

收获园豆:200
npe0 | 小虾三级 |园豆:1299 | 2023-12-12 17:30
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册