先说明一下:任何一个页面都应该按照布局的先后顺序来显示,我这出现的问题就是,Scrollview里面嵌套Listview的头布局一进来看不见了,直接被Listview把焦点给抢了。最先显示的是Listview的item部分。直接上图
解决代码在父布局里设置2个属性
android:focusable="true"
android:focusableInTouchMode="true"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.kyhh.youngworld.main.classification.activity.BrandListingActivity">
<include layout="@layout/system_titlebar_layouot" />
<com.kyhh.youngworld.widget.StickScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"