我的僱主讓我工作在一個非常具體的UI需求的android應用程序上。具體而言,我們需要一個與TabWidget接口完全相同的接口。但是,在左側有選項卡是絕對必須的。我們不打算將此應用程序部署到任何Android手機,它的內部設備,因此沒有任何問題違反Android平臺可能具有的任何設計考慮因素。android tabwidget的現有補丁允許左側的選項卡?
我們已經有了一個工作原型,可以使用焦點偵聽器和列表視圖的組合來將我們需要的功能集合在一起。這並不美妙,我們對此尚不十分自信,但它暫時有效。
我們真正想要的是拋棄所有的原型UI代碼,以換取使用內置的TabWidget。但是,由於TabWidget被硬編碼爲只能在頂部使用標籤,所以這不是一個真正的選擇。
因此,我們希望有人在那裏有一個補丁,或一組補丁,或者一個自定義類,它可以通過側面的選項卡來處理TabWidget功能?
和被硬編碼爲是在頂部標籤的具體功能是
private void initTabWidget() {
setOrientation(LinearLayout.HORIZONTAL);
mGroupFlags |= FLAG_USE_CHILD_DRAWING_ORDER;
final Context context = mContext;
final Resources resources = context.getResources();
if (context.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.DONUT) {
// Donut apps get old color scheme
if (mLeftStrip == null) {
mLeftStrip = resources.getDrawable(
com.android.internal.R.drawable.tab_bottom_left_v4);
}
if (mRightStrip == null) {
mRightStrip = resources.getDrawable(
com.android.internal.R.drawable.tab_bottom_right_v4);
}
} else {
// Use modern color scheme for Eclair and beyond
if (mLeftStrip == null) {
mLeftStrip = resources.getDrawable(
com.android.internal.R.drawable.tab_bottom_left);
}
if (mRightStrip == null) {
mRightStrip = resources.getDrawable(
com.android.internal.R.drawable.tab_bottom_right);
}
}
// Deal with focus, as we don't want the focus to go by default
// to a tab other than the current tab
setFocusable(true);
setOnFocusChangeListener(this);
}
如果任何人有任何的信息,我會非常感激。
這是一個真正的恥辱,TabActivty無法處理底部或旁邊的標籤本身。我不明白爲什麼這不是內置的。 我找到了一個關於android bug跟蹤器的bug報告,但是沒有任何跡象表明這會在很短的時間內發揮作用。 http://code.google.com/p/android/issues/detail?id=3862&can=1&q=TabWidget&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars#makechanges – 2010-08-17 20:04:41