使用视图寻呼机添加ImageView的上述标签实施 [英] Add imageview above tabs implemented using view pager
本文介绍了使用视图寻呼机添加ImageView的上述标签实施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的页面viewer.In我main.xml中我设置标题和网页浏览器,并在我的fragment.xml之我定义表格布局创建水平制表符。
I am creating horizontal tab using page viewer.In my main.xml I am setting header and page viewer and in my fragment.xml I am defining table layout.
我的main.xml -
My main.xml-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:src="@drawable/header1" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="90dp"
android:layout_alignParentLeft="true" >
<android.support.v4.view.PagerTabStrip
android:id="@+id/pager_tab_strip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:paddingBottom="4dp"
android:paddingTop="4dp"
android:textColor="#fff" >
</android.support.v4.view.PagerTabStrip>
</android.support.v4.view.ViewPager>
</RelativeLayout>
fragment.xml之 -
fragment.xml-
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:stretchColumns="0,1"
android:id="@+id/main_table"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_width="match_parent">
</TableLayout>
我想在tab.How前顶这个标题图片,我可以做到这一点?
I want this header image at the top before tab.How can I achieve this?
我想这种看法。
推荐答案
这可以通过添加MainActivity两行正在扩大FragmentActivity并在其中我们设置我们的标签来实现。
This can be implemented by adding two lines in MainActivity which is extending FragmentActivity and in which we are setting our tab.
getActionBar().setDisplayShowHomeEnabled(false);
ActionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.image_name));
这篇关于使用视图寻呼机添加ImageView的上述标签实施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文