2011-09-15 2 views
0

더 많은 타블렛과 호환되도록 만드는 앱이 있습니다. 전화 버전에서는 테마가 제목 표시 줄로 설정되어있어 휴대 전화에서 가장 잘 보입니다. Android 3.0에만 문제가 있습니다. 메뉴 버튼은 제목 표시 줄 (작업 표시 줄)로 이동합니다. 태블릿에 제목 표시 줄이 있지만 휴대 전화에 제목 표시 줄이 없는지 궁금합니다. 어떤 도움이라도 좋을 것입니다. 이처럼 보이는 Google I/O app source의 태블릿 검출하는 방법있다휴대 전화가 아닌 테이블에서는 제목 표시 줄을 사용할 수 있습니까?

감사

답변

1

: 당신은 단순히 호출 할 수 있습니다 귀하의 활동에

public class UIUtils { 

    public static boolean isHoneycomb() { 
     // Can use static final constants like HONEYCOMB, declared in later versions 
     // of the OS since they are inlined at compile time. This is guaranteed behavior. 
     return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB; 
    } 

    public static boolean isHoneycombTablet(Context context) { 
     // Can use static final constants like HONEYCOMB, declared in later versions 
     // of the OS since they are inlined at compile time. This is guaranteed behavior. 
     return isHoneycomb() && (context.getResources().getConfiguration().screenLayout 
       & Configuration.SCREENLAYOUT_SIZE_MASK) 
       == Configuration.SCREENLAYOUT_SIZE_XLARGE; 
    } 
} 

if (!UIUtils.isHoneycombTablet(this)) { 
    requestWindowFeature(Window.FEATURE_NO_TITLE); 
} 
+0

완벽한 덕분에 일했다 – Bobbake4