我遇到一个似乎与布局有关的Android APP的问题。附图中您会看到“警报”按钮突出显示并且与其他按钮看起来不一样。我用已知的好图像替换了图像,但问题仍然存在。
有人建议这是因为它是tabhost布局,但所有已推荐的更改都无效。到目前为止,我已经尝试将android:height和width中的属性更改为“wrap_content”,“fill_parent”和“match_parent”。匹配导致另一个奇怪的空白区域被纠正,但这个按钮是我最后一次明显的挑战。
这是布局代码,你能告诉我这是什么问题吗?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/btnSearch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/job_tab_bar_search"
android:focusable="false"
android:freezesText="false"
android:imeOptions="actionNext"
android:longClickable="false"
android:paddingLeft="17dp"
android:text="Search"
android:textColor="@color/color_text_default"
android:textSize="12dp"
android:visibility="visible" />
<Button
android:id="@+id/btnHistory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/job_tab_bar_history"
android:paddingLeft="25dp"
android:text="History"
android:textColor="@color/color_text_default"
android:textSize="12dp" />
<Button
android:id="@+id/btnFavorites"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/job_tab_bar_favorites"
android:paddingLeft="30dp"
android:text="Favorites"
android:textColor="@color/color_text_default"
android:textSize="12dp" />
<Button
android:id="@+id/btnAlerts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/job_tab_bar_alerts"
android:paddingLeft="12dp"
android:text="Alerts"
android:textColor="@color/color_text_default"
android:textSize="12dp" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.32" >
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</TabWidget>
</LinearLayout>
</TabHost>
答案 0 :(得分:0)
你认为有人会回答,最后这很简单。
答案是:
使用tabactivity的Tabhost如果重新调整大小,将通过菜单项显示背景。为模式添加颜色编码(html表示法)颜色,然后使用android:border-background结构调用它。