2012-04-06 26 views
0

我有我的應用程序中的滾動視圖,在我的模擬器中運行良好,但不能在Android設備上工作.....我的應用程序開發與minsdkversion:8 ...我部署我的應用在的android 2.2滾動視圖在模擬器中工作,但不能在Android設備上工作

我的佈局低於

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
android:scrollbars="vertical" 
android:layout_height="fill_parent" 
android:layout_width="fill_parent" 
android:background="#D2691E"> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:background="#D2691E" 
> 
<TextView 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:text="Branch" 
android:textColor="#000000" 
android:textSize="30px" 
/> 
<Spinner android:id="@+id/group" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:prompt="@string/group_prompt" 

/> 
<TextView 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:text="Year" 
android:textColor="#000000" 
android:textSize="30px" /> 
<Spinner android:id="@+id/year" 
    android:layout_width="match_parent" 


android:layout_height="wrap_content" 
    android:drawSelectorOnTop="true" 
    android:prompt="@string/year_prompt" 

/>  

<Button android:id="@+id/ok1_button" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" android:text="Ok1" android:ems="5">   
</Button> 
</LinearLayout> 
</ScrollView> 

PLZ給予solution..Thanks

+1

什麼設備上的問題? scrollview內的視圖被凍結? – 2012-04-06 08:58:03

+0

@Rahul garg ya .....我不能在設備中滾動,但我可以在模擬器上滾動模擬器 – 2012-04-06 09:02:27

+0

如何通過鼠標滾動按鈕或拖動光標滾動 – vipin 2012-04-06 09:05:04

回答

0

在你的2個Snippers與

替換您的代碼3210
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" > 

<ScrollView 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#D2691E" 
    android:scrollbars="vertical" > 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="#D2691E" 
     android:orientation="vertical" > 

     <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="Branch" 
      android:textColor="#000000" 
      android:textSize="30px" /> 

     <Spinner 
      android:id="@+id/group" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:drawSelectorOnTop="true" 
      android:prompt="@string/stringone" /> 

     <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="Year" 
      android:textColor="#000000" 
      android:textSize="30px" /> 

     <Spinner 
      android:id="@+id/year" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:drawSelectorOnTop="true" 
      android:prompt="@string/stringtwo" /> 

     <Button 
      android:id="@+id/ok1_button" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:ems="5" 
      android:text="Ok1" > 
     </Button> 
    </LinearLayout> 
</ScrollView> 

複製並粘貼到您的文件。將在2.1和2.2下工作。

+0

我的微調已經有第二次更改你提到 – 2012-04-06 09:40:14

+0

@kumar:保留整個文件,只需複製並粘貼到你的文件。 – Bhavin 2012-04-06 09:52:35

0

試試這個代碼

<?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"> 


    <ScrollView 
    android:scrollbars="vertical" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    android:background="#D2691E"> 
    <LinearLayout 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="#D2691E" 
    > 
    <TextView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="Branch" 
    android:textColor="#000000" 
    android:textSize="30px" 
    /> 
    <Spinner android:id="@+id/group" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:prompt="@string/group_prompt" 

    /> 
    <TextView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="Year" 
    android:textColor="#000000" 
    android:textSize="30px" /> 
    <Spinner android:id="@+id/year" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:drawSelectorOnTop="true" 
     android:prompt="@string/year_prompt" 

    />  

    <Button android:id="@+id/ok1_button" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" android:text="Ok1" android:ems="5">   
    </Button> 
    </LinearLayout> 
    </ScrollView> 
    </LinearLayout> 
+0

非常感謝...它正在工作...我的代碼怎麼了? – 2012-04-06 10:40:39

+0

如果它的工作,請將此標記爲接受 – vipin 2012-04-06 10:41:40

+0

嘿現在我也給每個佈局的xmlns:android =「schemas.android.com/apk/res/android」屬性,但它工作....什麼可能是共振爲scrollview不工作在我的上述代碼 – 2012-04-06 13:15:03

相關問題