启用或禁用代码中的edittext转换(如果按下“ EDIT”按钮)。 问题是:如果edittext包含大文本并且其状态被禁用,我将无法水平滚动查看所有文本。 (如果启用了他的状态,我可以正常水平滚动) ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
我正在使用SlidingPaneLayout制作“自定义”抽屉菜单,我需要通过单击工具栏导航按钮来禁用可拖动事件以仅显示服装抽屉,我的activity_main的结构为:
主要活动
<android.support.v4.widget.SlidingPaneLayout
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:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/slidingPaneLayout"
android:clickable="false"
android:scrollbarAlwaysDrawHorizontalTrack="false"
tools:context=".MainActivity.MainActivity">
<!--Costume Drawer fragment-->
<fragment
android:name="com.epcon.pdhgto.android.MenuFragment.MenuFragment"
android:layout_width="80dp"
android:layout_height="match_parent"
android:id="@+id/menu_master"
android:elevation="10dp">
</fragment>
<!--Fragment-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:id="@+id/mainFrameLayout"
>
</FrameLayout>
</android.support.v4.widget.SlidingPaneLayout>
换句话说,我需要在主要活动上禁用水平滚动。 我已经尝试过了: https : //stackoverflow.com/a/36447209/6308377 ,我也已经在我的xml android:scrollbarAlwaysDrawHorizontalTrack
上实现了,但这不起作用。
在您的主要活动中尝试
view.setHorizontalScrollBarEnabled(false);
或将其放在您的xml文件中
android:scrollbars="none"
另外,如果您想为自己的应用制作自定义菜单,则应查看导航抽屉
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.