Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android – ActionLayout没有显示,只有它的标题可见大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试将EditText添加到我的应用中的操作栏,但该项目不可见 – 只有其标题.我知道它发生在动作栏上没有足够的空间,但我不知道它为什么 – 屏幕肯定不是太小,没有更多的项目,我也尝试改变布局高度和宽度的值,但没有作品.
这是menu.xml中的项目:

<item
    android:id="@+id/title"
    android@R_737_6964@="title"
    android:actionLayout="@layout/action_bar"
    app:showAsAction="ifRoom" />

这是action_bar.xml布局文件

<LinearLayout xmlns:android="http://scheR_87_11845@as.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/edittitle
    android:hint="title"
    android:BACkground="#ffffff"
    android:textColor="#000000"
    android:gravity="right"
    />

解决方法

我已经知道了答案,而不是android:actionLayout我应该写app:actionLayout,第一个案例无法正常使用AppCompat

大佬总结

以上是大佬教程为你收集整理的android – ActionLayout没有显示,只有它的标题可见全部内容,希望文章能够帮你解决android – ActionLayout没有显示,只有它的标题可见所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。