2012-09-22 2 views
1

이미지 버튼이 많은 scrollView를 만들고 있습니다. 불행히도이보기는로드하는 데 시간이 오래 걸립니다. 사용자가 실수로 앱을 종료 할 가능성이 많습니다.이미지 버튼 안드로이드의 느린 로딩 시간

이 프로세스를 더 빨리 수행 할 수있는 방법에 대한 아이디어가 있습니까?

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" > 

<TableLayout 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    > 
    <TableRow> 
     <ImageButton 
      android:id="@+id/ImageButtonCone" 
      android:layout_width="160dp" 
      android:layout_height="200dp" 
      android:scaleType="fitCenter" 
      android:background="@drawable/cone" 
      /> 
     <ImageButton 
      android:id="@+id/ImageButtonCube" 
      android:layout_width="160dp" 
      android:layout_height="200dp" 
      android:scaleType="fitCenter" 
      android:background="@drawable/cube" 
      /> 
    </TableRow> 
      <TableRow> 
     <ImageButton 
      android:id="@+id/ImageButtonCylinder" 
      android:layout_width="160dp" 
      android:layout_height="200dp" 
      android:scaleType="fitCenter" 
      android:background="@drawable/cylinder" 
      /> 
     <ImageButton 
      android:id="@+id/ImageButtonTrapezoidalprism" 
      android:layout_width="160dp" 
      android:layout_height="200dp" 
      android:scaleType="fitCenter" 
      android:background="@drawable/trapezoidal_prism" 
      /> 

등 ... 내가 문제를 해결했습니다

+0

버튼 몇 개입니까? – Simon

+0

12 (더 추가하고 싶었지만 ... 두 번째 페이지를 만들어야 할 수도 있음) - 에뮬레이터에서 작동 (ok)하지만 전화는 영원히 걸립니다. – Kurt

+1

에뮬레이터가 장치보다 빠릅니다. – Ronnie

답변

2

은 ... 난 단지 PNG의 드로어 블 - MDPI 폴더의가 아닌 다른 당김 폴더했다. 각 PNG의 사본을 만들어서 drawable-ldpi, drawable-mdpi 및 drawable-xhdpi로 붙여 넣었습니다. 이제는 에뮬레이터뿐만 아니라 전화기에서도 매우 빠르게 작동합니다.

아마도 에뮬레이터는 매체 정의 .png를 사용하고 있었지만 전화는 다른 해상도에서 가져 가고 싶지 않았기 때문에 가능하지 않았습니다.