2012-04-06 50 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

相关问题