-2
<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=".MainActivity">
<EditText
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/location_edittext"
android:id="@+id/locationEditext"
android:textSize="15sp"
android:textColor="#999"
android:paddingLeft="15dp" />
<com.example.ravi_gupta.slider.ViewPagerCustomDuration
android:layout_width="wrap_content"
android:layout_height="0dp"
android:id="@+id/viewPager"
android:scrollbarStyle="outsideOverlay"
android:layout_weight="0.5">
</com.example.ravi_gupta.slider.ViewPagerCustomDuration>
<ListView
android:layout_weight="0.50"
android:layout_below="@+id/viewPager"
android:layout_marginTop="2dp"
android:layout_width="match_parent"
android:layout_height="45dp"
android:id="@+id/shopListview" />
这是我在activity.main代码我,我要的是,当我滚动列表视图它需要在布局中的所有空间隐藏viewpager和editext当我向后滚动显示它们,我不知道这是怎么可能的,我应该使用相对布局或其他方法
你已经给列表视图和高度赋予权重,为什么呢? – frost
我试图通过重量显示listview的高度ot,但这种解决方案似乎不起作用 – Ravi
如果你给重量,那么不需要高度 – frost