저는 현재 4 개의 탭이있는 레이아웃을 가지고 있습니다. 첫 번째 탭에는 앱의 홈 화면이 있고 다른 활동 아이콘에는 4 개의 이미지 뷰가로드됩니다. 두 번째 탭은 세 번째 탭과 마찬가지로 webview (매우 기본적인 탭)를로드합니다. 마지막 탭은지도를로드합니다. 앱이 매우 느리게로드되고 약 11 초가 걸리며 Eclipse에서 디버깅 할 때 거의 모든 시간이 setContentView에 소요되지만 내 레이아웃에서로드하는 데 너무 오래 걸리는 부분을 파악할 수 없습니다.레이아웃로드 시간을보다 효율적으로 만들려면 어떻게해야합니까?
<?xml version="1.0" encoding="utf-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabhost" android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
>
<RelativeLayout
android:id="@+id/tab1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/background"
>
<ImageView
android:id="@+id/HomeButtonEvents"
android:src="@drawable/eventsicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:paddingBottom="95dp"
android:clickable="true"
/>
<ImageView
android:id="@+id/CancelledClasses"
android:src="@drawable/cancelledicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
/>
<ImageView
android:id="@+id/CourseSchedule"
android:src="@drawable/coursesicon"
android:layout_width="141dp"
android:layout_height="139dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
/>
<ImageView
android:id="@+id/POTD"
android:src="@drawable/potdicon"
android:layout_width="294dp"
android:layout_height="247dp"
android:paddingTop="45dp"
android:paddingRight="1dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/CourseSchedule"
/>
<!-- <ImageView -->
<!-- android:id="@+id/potdview"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:paddingTop="0dp" -->
<!-- android:paddingRight="1dp"-->
<!-- android:paddingBottom="150dp" -->
<!-- android:layout_alignParentTop="true"-->
<!-- android:layout_alignParentRight="true" -->
<!-- android:layout_toRightOf="@id/CourseSchedule" -->
<!-- /> -->
</RelativeLayout>
<WebView
android:id="@+id/tab2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</FrameLayout>
<TabWidget
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
/>
</LinearLayout>
</TabHost>
모든 아이디어/제안 : 여기
내 레이아웃 코드인가?
코드를보다 읽기 쉽게 포맷했습니다. 특히이 문제가 귀하의 문제인지는 모르겠지만 XML 태그 내에 주석 줄 ('')을 사용할 수는 없습니다. 블록을 주석 처리하기 위해서는' ->'로 끝나야합니다. – kcoppock
문제점에 영향을 미치지 않았던 형식화 팁을 주셔서 감사합니다. Eclipse에서 토글 주석 기능을 사용하고있었습니다. – Brandon