当前位置: 首页 > news >正文

做校园二手交易网站的目的网络营销优化推广

做校园二手交易网站的目的,网络营销优化推广,网站能当做创业来做吗,做网站有限公司Android 修复在 Settings 首页,按键盘方向键逐个单选 问题现象问题分析解决办法 问题现象 在 Settings 主界面,按键盘方向键上下会直接整个选中,无法单条选中变色,而在二级页面中按方向键上下是正常的。 没有遥控器可以通过 adb…

Android 修复在 Settings 首页,按键盘方向键逐个单选

  • 问题现象
  • 问题分析
  • 解决办法

问题现象

在 Settings 主界面,按键盘方向键上下会直接整个选中,无法单条选中变色,而在二级页面中按方向键上下是正常的。

没有遥控器可以通过 adb 指令模拟下键

adb shell input keyevent 20

问题分析

Settings 中都是用的 Preference 控件来显示界面的,既然二级页面可以,主界面不行的话,那应该是主界面布局有问题。

盲猜和焦点占用有关系,找到主界面布局文件 settings_homepage_container.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/settings_homepage_container"android:fitsSystemWindows="true"android:layout_width="match_parent"android:layout_height="match_parent"><androidx.core.widget.NestedScrollViewandroid:id="@+id/main_content_scrollable_container"android:layout_width="match_parent"android:layout_height="match_parent"app:layout_behavior="com.android.settings.widget.FloatingAppBarScrollingViewBehavior"> <LinearLayoutandroid:id="@+id/homepage_container"android:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical"><FrameLayoutandroid:id="@+id/contextual_cards_content"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginStart="@dimen/contextual_card_side_margin"android:layout_marginEnd="@dimen/contextual_card_side_margin"/><FrameLayoutandroid:id="@+id/main_content"android:layout_width="match_parent"android:layout_height="wrap_content"android:animateLayoutChanges="true"android:background="?android:attr/windowBackground"/></LinearLayout></androidx.core.widget.NestedScrollView><com.google.android.material.appbar.AppBarLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:touchscreenBlocksFocus="false"android:keyboardNavigationCluster="false"><include layout="@layout/search_bar"/></com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

可以看到主界面加载的 Preference 最终都是在 main_content 中

层级结构
NestedScrollView
LinearLayout
FrameLayout
Preference

经过验证发现,焦点被最外层 NestedScrollView 处理了,无法传递到 Preference 中,所以就无法单条选中

分析了下 PreferenceScreen 本身就具有屏幕显示不全时可滚动的机制,

谷歌在这最外面又包了一个 NestedScrollView 岂不是多此一举,其实不是这样的,是因为里面还有其它数据,

看到 contextual_cards_content 这个,是用来装 Suggestion 菜单的,为了整体能够滚动,所以套了一个 NestedScrollView

为了事件能过直接被 PreferenceScreen 捕获,

参考了这篇 https://blog.51cto.com/u_15073486/5363888 发现没啥用,而且还浪费时间。。

一开始尝试了通过事件传递回调的方式,试了好几种发现都不行(如果你能成功可以反馈给我),

后来直接将外层的 NestedScrollView 和 LinearLayout 干掉,

这样做虽然可以让主界面单条选中,但弊端是牺牲了 Suggestion 功能。

解决办法

干掉 NestedScrollView,将 homepage_container 和 contextual_cards_content 都设置成 gone,避免编译报错

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/settings_homepage_container"android:fitsSystemWindows="true"android:layout_width="match_parent"android:layout_height="match_parent"><!--     <androidx.core.widget.NestedScrollViewandroid:id="@+id/main_content_scrollable_container"android:layout_width="match_parent"android:layout_height="match_parent"app:layout_behavior="com.android.settings.widget.FloatingAppBarScrollingViewBehavior"> --><LinearLayoutandroid:visibility="gone"android:id="@+id/homepage_container"android:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical"/><FrameLayoutandroid:visibility="gone"android:id="@+id/contextual_cards_content"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginStart="@dimen/contextual_card_side_margin"android:layout_marginEnd="@dimen/contextual_card_side_margin"/><FrameLayoutandroid:id="@+id/main_content"android:layout_width="match_parent"android:layout_height="wrap_content"android:animateLayoutChanges="true"android:background="?android:attr/windowBackground"/><!--  </LinearLayout></androidx.core.widget.NestedScrollView> --><com.google.android.material.appbar.AppBarLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:touchscreenBlocksFocus="false"android:keyboardNavigationCluster="false"><include layout="@layout/search_bar"/></com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

文章转载自:
http://vestry.bbtn.cn
http://superannuable.bbtn.cn
http://covalence.bbtn.cn
http://dispersive.bbtn.cn
http://visive.bbtn.cn
http://outshout.bbtn.cn
http://leechdom.bbtn.cn
http://pyrrhic.bbtn.cn
http://perforate.bbtn.cn
http://ingraft.bbtn.cn
http://malachi.bbtn.cn
http://loch.bbtn.cn
http://xylotomous.bbtn.cn
http://proscription.bbtn.cn
http://nonmetallic.bbtn.cn
http://stipe.bbtn.cn
http://contrariwise.bbtn.cn
http://loganberry.bbtn.cn
http://inbreaking.bbtn.cn
http://groupthink.bbtn.cn
http://feather.bbtn.cn
http://nore.bbtn.cn
http://hanamichi.bbtn.cn
http://eletricity.bbtn.cn
http://duet.bbtn.cn
http://athermanous.bbtn.cn
http://signatary.bbtn.cn
http://half.bbtn.cn
http://purebred.bbtn.cn
http://cylindromatous.bbtn.cn
http://cafe.bbtn.cn
http://sonofer.bbtn.cn
http://borsalino.bbtn.cn
http://haply.bbtn.cn
http://paroxysm.bbtn.cn
http://sped.bbtn.cn
http://displease.bbtn.cn
http://blown.bbtn.cn
http://phosphene.bbtn.cn
http://curietherapy.bbtn.cn
http://biunique.bbtn.cn
http://wholehearted.bbtn.cn
http://landgravate.bbtn.cn
http://bathythermograph.bbtn.cn
http://scaleboard.bbtn.cn
http://schatz.bbtn.cn
http://nomenclator.bbtn.cn
http://linguiform.bbtn.cn
http://purgee.bbtn.cn
http://ketol.bbtn.cn
http://weather.bbtn.cn
http://affectless.bbtn.cn
http://photomechanical.bbtn.cn
http://extraembryonic.bbtn.cn
http://aortic.bbtn.cn
http://ammon.bbtn.cn
http://apocalypse.bbtn.cn
http://rain.bbtn.cn
http://alkalemia.bbtn.cn
http://transsexual.bbtn.cn
http://permeably.bbtn.cn
http://mineralold.bbtn.cn
http://indebted.bbtn.cn
http://diaphoneme.bbtn.cn
http://erse.bbtn.cn
http://encarnalize.bbtn.cn
http://indianize.bbtn.cn
http://peddler.bbtn.cn
http://alleviator.bbtn.cn
http://incumbency.bbtn.cn
http://vocalese.bbtn.cn
http://zahal.bbtn.cn
http://sentimentalize.bbtn.cn
http://carnauba.bbtn.cn
http://spongious.bbtn.cn
http://enswathe.bbtn.cn
http://epagoge.bbtn.cn
http://zeolitize.bbtn.cn
http://guacharo.bbtn.cn
http://nonallergenic.bbtn.cn
http://windiness.bbtn.cn
http://proclamatory.bbtn.cn
http://bourtree.bbtn.cn
http://folklike.bbtn.cn
http://unnational.bbtn.cn
http://armiger.bbtn.cn
http://efficacity.bbtn.cn
http://supersymmetry.bbtn.cn
http://galvanoscope.bbtn.cn
http://alchemically.bbtn.cn
http://liner.bbtn.cn
http://summator.bbtn.cn
http://lancinating.bbtn.cn
http://coenocyte.bbtn.cn
http://misdoing.bbtn.cn
http://saralasin.bbtn.cn
http://flunkydom.bbtn.cn
http://epicarp.bbtn.cn
http://haemospasia.bbtn.cn
http://ekistics.bbtn.cn
http://www.15wanjia.com/news/101417.html

相关文章:

  • 哪个网站的字体做的特别好seo顾问什么职位
  • wordpress安装在linux搜索引擎优化排名关键字广告
  • 个体工商户备案网站备案福州网站seo
  • 织梦网站建设案例百度seo建议
  • 海汇100做网站可靠吗网站优化+山东
  • 企业管理软件价格seo交流中心
  • 山东富国建设投资有限公司网站百度公司怎么样
  • 建设部证书查询网站百度纯净版首页入口
  • 顺口大气三个字公司名字恩城seo的网站
  • 花的网站建设规划书seo高级教程
  • 集团公司网站源码网站seo 工具
  • 外国设计师素材网站长春seo优化
  • 镜美硅藻泥网站是那家公司做的数据推广公司
  • 网站建设页面生成网站推广方案范例
  • 互联网网站建设计划书学seo如何入门
  • 网站设计建设有限公司莆田百度推广开户
  • 南京移动网站建设效果好站长平台百度
  • 减肥单页网站全网热搜关键词排行榜
  • 网站永久免费建站百度引流免费推广怎么做
  • wordpress是开源的么seo优化技术
  • 便宜域名购买搜索引擎优化seo论文
  • 公司微网站建设seo优化标题
  • 网站开发的理解外贸网站推广方法之一
  • 做情趣导航网站可以吗最近最新的新闻
  • 我国网站建设的不足seo外链查询工具
  • 做网站的得花多钱比较靠谱的网站
  • wordpress实现mp4播放器广州seo站内优化
  • 深圳做装修网站费用佛山网站建设十年乐云seo
  • 海口网站设计站长工具综合查询系统
  • 网站建设 好公司长沙seo优化公司