我想有一個佈局像下面Android在TabWidget的左側添加一個圖像並在其右側添加一個edittext權限?
圖片TabName1 TabName2 TabName3的EditText
< --------------------選項卡內容--- ------------------->
我下面的xml不起作用。該圖像將顯示在標籤的頂部和的EditText甚至沒有被顯示在所有...
<?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:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/logo1" />
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:showDividers="none"
android:background="#F0F0F0" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp" />
<EditText
android:layout_weight="1"
android:id="@+id/qsearch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:lines="1"
android:maxLines="1"
android:scrollHorizontally="true"
android:ellipsize="end"
android:inputType="text"
android:imeOptions="actionSearch|flagNoExtractUi" >
<requestFocus />
</EditText>
</LinearLayout>
</TabHost>
如果它不起作用請發佈所需的圖像.... –
嗨,與您的XML圖像仍然在標籤上方,編輯框是在標籤的底部。我需要他們都在同一行/行。 – Eddi
你的意思是水平嗎? –