안녕 얘들 아, 아마 일부 소녀, 레이아웃 개체를 쌓을 수 있습니다. 그래서 하나의 객체가 다른 객체 위에있다? 내 문제는, 내가 tabhost있어 tabhostow tabview 아래에있는 textview 있어요.서로 다른 레이아웃 오브젝트를 스택하는 방법은 무엇입니까?
나는 탭 호스트 탭을 보이지 않게 만들었지 만, 내 tablrow를 텍스트 뷰어로 숨겼는데, 어떻게 그것을 infront 할 수 있습니까?
여기에 사전에
<?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"
android:weightSum="1">
<RelativeLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" />
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom = "@android:id/tabcontent"
android:visibility="invisible"/>
<TableRow
android:id="@+id/ADFilterOverview"
android:layout_height="wrap_content"
android:onClick="onClickADConfig"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignTop="@android:id/tabs"
android:layout_width="match_parent">
<TextView
android:text="@string/newadfilter"
style="@style/NormalFont"
android:layout_gravity="bottom|left">
</TextView>
</TableRow>
</RelativeLayout>
</TabHost>
들으
안부 사파리
더 나은 이해를위한 몇 가지 자세한 내용은 Layout.xml에게 있습니다 : 내 활동의 이후 내 코드
다음과 같이 보입니다.
package de.retowaelchli.filterit;
import android.app.TabActivity;
import android.os.Bundle;
import android.widget.TabHost;
import android.content.Intent;
public class StatsActivity extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.stats);
TabHost tabHost = getTabHost();
tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("whatever").setContent(new Intent(this, SFilterStatsActivity.class)));
tabHost.setCurrentTab(1);
}
/** Verweise auf die anderen Seiten **/
public void onClickADConfig(View view){
final Intent i = new Intent(this, ADFilterConfigActivity.class);
startActivity(i); }
}
내 Tabhost에서 링크 된 클래스는 다음과 같은 예를 들어 본다 : 당신이 볼, 난 내 ListActivity에서 가득 그것은 하나 개의 탭이있는 TabHost를 가지고 그래서
package de.retowaelchli.filterit;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
public class ADFilterStatsActivity extends ListActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mListContent));
}
private static String[] mListContent={"Item 1", "Item 2", "Item 3","Item 1", "Item 2", "Item 3","Item 1", "Item 2", "Item 3","Item 1", "Item 2", "Item 3"};
}
에서, tabhost가 숨겨져 야 (보이지 않는),이 숨겨진 탭 위에 tablerow 표시되어야합니다. 그래서 나는 그것을 클릭하여 다른 클래스에 갈 수 있습니다. 나는이 너희들 도움이되기를 바랍니다 ...
이 Egon
그리고 여기가
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<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">
<RelativeLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" />
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom = "@android:id/tabcontent"
android:visibility="invisible"/>
<TableRow android:layout_height="wrap_content" android:id="@+id/ADFilterOverview" android:layout_width="match_parent" android:onClick="onClickADConfig" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true">
<TextView android:layout_gravity="bottom|left" android:text="@string/newadfilter" style="@style/NormalFont"></TextView>
</TableRow>
</RelativeLayout>
</TabHost>
</FrameLayout>
왜 당신은 당신의 TabHost 보이지 않는가? – user370305
나는 하나의 탭만 가지고 있으며, 항상 탭으로 구성되어 있고 데이터베이스에서 채워지는 ListActivity의 내용으로 채워져있다. 나는이 Tabhost에서 나중에 보여지는 데이터베이스에 대한 내용을 설정할 수있는 다음 활동으로 Tablerow가 필요합니다. =) 항상 Tab을 사용했기 때문에 – safari
을 이해하기를 바랍니다. 왜 TabHost를 사용합니까? –