私のアプリケーションでは、メニュー スライダーと水平スライダー コードが追加されました。トウリニアレイアウト内の水平レイアウトでは、それぞれが異なる背景です。
同じバックグラウンド作業ファイルを提供する場合。私が別のバックグラウンドアプリを提供すると、非常に遅くなります。
以下に、コードとレイアウトを示します。
私のレイアウトコード:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/relBg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/img1" >
<RelativeLayout
android:id="@+id/relBg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/img2" >
<com.application.utils.HorizontalPager
android:id="@+id/horizontal_pager"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/homebg"" >
<include
android:layout_width="fill_parent"
android:layout_height="fill_parent"
layout="@layout/homepageview" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/cal_bg" >
<include
android:layout_width="fill_parent"
android:layout_height="fill_parent"
layout="@layout/calendarview" />
</LinearLayout>
</com.application.utils.HorizontalPager>
</RelativeLayout>
</RelativeLayout>
画像サイズは 40kb のみです。
異なる画像を使用したこの 2 つの相対的なレイアウトでは、このアプリのように使用すると非常に遅くなります。
私のコード:
LayoutInflater inflater = LayoutInflater.from(this);
scrollView = (FacebookSlideView) inflater.inflate(R.layout.screen_scroll_with_list_menu, null);
setContentView(scrollView);
final Stack stack=new Stack();
menu = inflater.inflate(R.layout.profile_menu, null);
app = inflater.inflate(R.layout.homepage, null);
btnSlide = (Button) app.findViewById(R.id.BtnSlide);
fadeGray_Rel = (LinearLayout)app.findViewById(R.id.fadeGray_Rel);
fadeGray_Rel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
slideAnimation(scrollView, menu);
}
});
同じ画像を使用すると、両方の相対レイアウトが正常に機能し、遅くなりません。
私のlogcatの詳細:
11-13 14:37:24.834: I/Choreographer(2605): Skipped 34 frames! The application may be doing too much work on its main thread.
11-13 14:37:24.838: D/OpenGLRenderer(2605): TextureCache::callback: name, removed size, mSize = 68, 11632640, 13043632
11-13 14:37:24.838: D/OpenGLRenderer(2605): TextureCache::get: create texture(0xb96d2358): name, size, mSize = 75, 1048576, 14092208
11-13 14:37:24.838: D/OpenGLRenderer(2605): TextureCache::callback: name, removed size, mSize = 69, 11632640, 2459568
11-13 14:37:25.078: D/OpenGLRenderer(2605): TextureCache::get: create texture(0xb96fdfa0): name, size, mSize = 76, 11632640, 14092208
ありがとう