-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