현재 어플에 어바웃 화면을 구성하기 위해
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/_about_bg"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<TextView
android:id="@+id/build_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="240dp"
android:layout_marginTop="162dp"
android:textColor="#F2EDD3"
android:textSize="10.666dp"
android:textStyle="bold"
/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="34.666dp"
android:layout_marginRight="34.666dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="50dp">
<ImageButton
android:id="@+id/recommend_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/drawable_about_tel_btn"/>
<ImageButton
android:id="@+id/home_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="@drawable/drawable_about_home_btn"/>
<ImageButton
android:id="@+id/support_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@drawable/drawable_about_support_btn"/>
</RelativeLayout>
</RelativeLayout>
위와 같이 레이아웃을 구성하였습니다.
이미지 뷰의 백그라운드는 로케일에 따라 다르게 줘야 해서 소스상에서 주고 있구요
소스는 아래와 같습니다..
public class About extends Activity {
// Constant {
private static final int ABOUT_RECOMMEND = 1001;
private static final int ABOUT_HYPERLINK = 1002;
private static final int ABOUT_SUPPORT = 1003;
private static final boolean T_STORE_BUILD = false;
private ImageView backgroundView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
doInitAbout();
}
@Override
protected void onRestart() {
super.onRestart();
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onStop() {
super.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
}
private void doInitAbout() {
ImageButton aboutRecommendBtn = (ImageButton) findViewById(R.id.recommend_btn);
backgroundView = (ImageView) findViewById(R.id._about_bg);
String language = getResources().getConfiguration().locale.getLanguage();
if (language.equals("ko")) {
backgroundView.setBackgroundResource(R.drawable.about_kor);
} else {
backgroundView.setBackgroundResource(R.drawable.about_eng);
}
if (T_STORE_BUILD) {
aboutRecommendBtn.setVisibility(View.GONE);
} else {
aboutRecommendBtn.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(
android.content.Intent.ACTION_SEND);
intent.addCategory("android.intent.category.DEFAULT");
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_SUBJECT,
getString(R.string.about_recommend_subject));
intent.putExtra(Intent.EXTRA_TEXT,
getString(R.string.about_recommend_text));
startActivityForResult(Intent.createChooser(intent,
getText(R.string.chooser)), ABOUT_RECOMMEND);
}
});
}
ImageButton aboutHomeBtn = (ImageButton) findViewById(R.id.home_btn);
aboutHomeBtn.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
//생략..
}
});
ImageButton aboutSupportBtn = (ImageButton) findViewById(R.id.support_btn);
aboutSupportBtn.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
//생략
}
});
TextView mBuildDate = (TextView) findViewById(R.id.build_date);
// Date date = new Date();
// String buildDate = date.toLocaleString() + " (Build)";
String buildDate = "Oct 7 2010, 09:30 00 (Build)";
mBuildDate.setText(buildDate);
}
}
간단한 소스 구요... 그런데 세개의 버튼 가운데 하나가 보이질 않습니다.. 항상은 아니고 가끔 보이기도 하고..-ㅅ-;;;
보이지 않는 버튼의 Drawable 이름이나 이미지 이름을 바꿔주면 그 버튼은 보이는데 다른 하나가 안보이고... 또 안보이는 버튼을
수정하면 다른 하나가 안보이고... 백그라운드의 이미지뷰가 안보일때도 있고...
이건 누가 장난치는것 같습니다..ㅠㅠ
백그라운드 이미지는 800*400, 612kb 이미지구요... 이미지 버튼의 노말/셀렉트 이미지도 200*50, 20kb정도 입니다...
이 액티비티만 생성하는 어플을 만들어서 사용하면 잘 나옵니다..
다만 제가 작업하는 어플에서만 문제를 일으킵니다... 좀 메모리를 많이 잡아먹고 있긴 하지만 전혀 저런 현상이 나타날 이유는 없는것 같은데
도저히 해답도 원인도 찾지를 못하겠습니다..ㅠㅠ
혹시 이와 같은 경우를 보셨거나 원인이나 해결책을 아시는 분 있나요...



