android – 在完整的应用程序中隐藏滚动条

android – 在完整的应用程序中隐藏滚动条,第1张

概述我需要从整个应用程序中删除滚动条. 我想避免在我的应用程序中定义的所有ScrollViews中编写 android:scrollbars =“none”的麻烦. 现在,这是我试图做的: styles.xml <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.NoActionBar" 我需要从整个应用程序中删除滚动条.
我想避免在我的应用程序中定义的所有ScrollVIEws中编写 android:scrollbars =“none”的麻烦.

现在,这是我试图做的:

styles.xml

<!-- Base application theme. -->    <style name="Apptheme" parent="theme.AppCompat.NoActionbar">        <item name="colorPrimary">@color/colorPrimary</item>        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>        <item name="colorAccent">@color/colorAccent</item>        <item name="androID:scrollVIEwStyle">@style/NoScrollbars</item>        <item name="androID:scrollbarStyle">@style/NoScrollbars</item>    </style><style name="NoScrollbars" parent="androID:Widget.ScrollVIEw">    <item name="androID:scrollbars">none</item></style>

有没有办法让这种情况发生?

解决方法 您可以在主题中定义ScrollVIEwStyle和ListVIEwStyle:

<style name="theme.Mytheme" parent="androID:theme.Holo">    <item name="androID:ListVIEwStyle">@style/Widget.Mytheme.ListVIEw</item>    <item name="androID:scrollVIEwStyle">@style/Widget.Mytheme.ScrollVIEw</item></style><style name="Widget.Mytheme.ListVIEw" parent="androID:Widget.ListVIEw">    <item name="androID:overScrollMode">never</item>    <item name="androID:scrollbars">none</item></style><style name="Widget.Mytheme.ScrollVIEw" parent="androID:Widget.ScrollVIEw">    <item name="androID:overScrollMode">never</item>    <item name="androID:scrollbars">none</item></style>

然后你必须在AndroIDManifest.xml中定义你的主题:

<?xml version="1.0" enCoding="utf-8"?><manifest xmlns:androID="http://schemas.androID.com/apk/res/androID"      package="nouman.app.example"      androID:versionCode="1"      androID:versionname="1.0"><uses-sdk androID:targetSdkVersion="16" androID:minSdkVersion="8"/><application        androID:harDWareAccelerated="true"        androID:label="@string/app_name"        androID:icon="@drawable/ic_launcher"        androID:theme="@style/theme.Mytheme">

而已.完成.

总结

以上是内存溢出为你收集整理的android – 在完整的应用程序中隐藏滚动条全部内容,希望文章能够帮你解决android – 在完整的应用程序中隐藏滚动条所遇到的程序开发问题。

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

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1123987.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存