Android WebView внутри вкладки всегда соответствует полноэкранному - PullRequest
0 голосов
/ 22 февраля 2012

Мне нужен веб-просмотр внутри вкладки, это должно быть легкой задачей, но я часами читаю посты и предложения по тестированию, и я не могу найти решение! Обратите внимание, что вкладки внизу, сверху работает! Я изменил макеты, создать конкретные виды деятельности и многое другое. Затем веб-просмотр по-прежнему подходит для полноэкранного режима! Я буду рад опубликовать код в случае необходимости!

1 Ответ

3 голосов
/ 22 февраля 2012

Попробуйте это

Webview Xml..................

<?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="match_parent"
    android:background="@drawable/ab02_bg" >


            <WebView android:autoLink="web" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:src="@drawable/ticket_text"
                android:id="@+id/TextViewMorTickets" android:textColor="@android:color/black"></WebView>

Tab Xml ....................

<?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:background="@drawable/ab02_bg" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
        <ImageView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/hddr" >
        </ImageView>
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1" >
        </FrameLayout>
         <ImageView
            android:layout_width="fill_parent"
            android:layout_height="30dip"

            android:baselineAlignBottom="true"
            android:id="@+id/BannerImage"
            >
        </ImageView>
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"                    
            android:layout_height="wrap_content"
            android:layout_weight="0" 
            android:tabStripEnabled="false"
     />
    </LinearLayout>

</TabHost>
</LinearLayout>

Java-файл ............................

@Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tablayout);
                tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec; 
                spec = tabHost.newTabSpec("TICKETS").setIndicator("").setContent( new Intent().setClass(this, webview.class));

        tabHost.addTab(spec);
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...