2010-07-18 78 views

回答

0

只需在布局的顶部添加该栏,然后用ScrollView包装其余内容即可。例如:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <!-- Header --> 
    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="Your header"/> 

    <!-- rest of your layout --> 
    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="fill_content"> 
      <TextView 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:text="Foo"/> 
      <TextView 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:text="Bar"/> 
      <TextView 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:text="Baz"/> 
      <TextView 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:text="etc"/> 
     </ScrollView> 
</LinearLayout> 

这样一来,你的观点的包裹部分将滚动而将保持在同一个站点。

+0

甜,我会试试看,谢谢Cristian。 – dhulihan 2010-07-19 05:07:05

+0

+1我需要类似的东西,但我需要底部的浮动弹出窗口,虽然起点不错! – AgentKnopf 2013-02-19 09:57:16