2012-01-05 2 views
0

나는 TabActivity를 사용하는 응용 프로그램을 가지고 있지만 ICS에서 잘못 렌더링되고 있습니다. 탭이 다른 용도로도 여전히 작동하기 때문에 ActionBar 또는 Fragments에 대한 솔루션에 관심이 없습니다. 여기안드로이드 ICS 표시 tabactivity 탭이 잘못됨

은 안드로이드의 다른 모든 버전 (원하는 모양) http://i44.tinypic.com/fb9jya.png

여기가 잘못된 ICS에 모습입니다에 모습입니다. 여기

http://i44.tinypic.com/35btjl2.png

내 tabactivity 탭 코드, 무엇을 변경해야입니까? 여기

intent = new Intent().setClass(this, HomeMenuGroup.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
    spec = tabHost.newTabSpec("homeMenuGroup").setIndicator(li.inflate(R.layout.main_tabs_home, tabHost.getTabContentView(), false)) 
      .setContent(intent); 
    tabHost.addTab(spec); 

    // Do the same for the other tabs 
    intent = new Intent().setClass(this, BuyTicketsGroup.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
    spec = tabHost.newTabSpec("buyTicketsGroup").setIndicator(li.inflate(R.layout.main_tabs_buy, tabHost.getTabContentView(), false)) 
      .setContent(intent); 
    tabHost.addTab(spec); 

    intent = new Intent().setClass(this, UseTicketsGroup.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
    spec = tabHost.newTabSpec("useTicketsGroup").setIndicator(li.inflate(R.layout.main_tabs_use, tabHost.getTabContentView(), false)) 
      .setContent(intent); 
    tabHost.addTab(spec); 

    intent = new Intent().setClass(this, MyAccountGroup.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
    spec = tabHost.newTabSpec("myAccountGroup").setIndicator(li.inflate(R.layout.main_tabs_account, tabHost.getTabContentView(), false)) 
      .setContent(intent); 
    tabHost.addTab(spec); 

및 내 탭 버튼 레이아웃 XML R.layout.main_tabs_account

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  android:layout_width="wrap_content" android:layout_height="wrap_content"> 
<TextView android:background="@drawable/switcher_account" 
     android:layout_width="80dip" 
     android:layout_height="60dip"/> 
</LinearLayout> 

답변

2

당신에게 확실한 대답을주고 힘든 중 하나입니다. 예를 들어 인용 된 R.layout.main_tabs_account 레이아웃에는 캡쳐 화면에 표시되는 ImageView이 포함되어 있지 않으므로 질문 내에서 어떤 것이 동기화되지 않았 음을 나타냅니다.

말했다되는 것을 여기에 내가 시도 할 작업은 다음과 같습니다

  • LinearLayoutTextView에서 치수를 이동

    . 귀하의 텍스트는 80x60 딥으로되어 있지 않습니다. 아마도 귀하의 탭이 있습니다.

  • 더 많은 단서를 제공 할 수 있으므로 TabHostTabWidget이 포함 된 레이아웃 게시를 고려하십시오.

  • 사용자 정의 탭을 사용하는 this project을 살펴보고 내가 접근하는 방법에있어 도움이되는지 확인하십시오. 이 프로젝트는 Android 4.0에서 잘 작동합니다.

+0

'main_tabs_content'에 대해 알려 주셔서 감사합니다. 상태가있는 배경 drawable이있는 textview입니다. 선형 레이아웃을 제거하고 텍스트 뷰를 이미지 뷰 – CQM

+0

으로 변경하면 어떻게되는지 알 수 있습니다. 답장을 보내 주셔서 감사합니다. 나는 당신의 추천을 읽었을 때 그것을 해시했고 내가 상상 한 것이 잘못되었을 수도 있습니다. 다른 2.x 장치에서 테스트하여 방금 compabitility를 유지했는지 확인합니다. – CQM