Android viewpager与大屏幕中的父项不匹配
我的视图中有一个viewpager,如下所示:Android viewpager与大屏幕中的父项不匹配,android,android-fragments,android-actionbar,android-viewpager,Android,Android Fragments,Android Actionbar,Android Viewpager,我的视图中有一个viewpager,如下所示: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ci_pager" android:layout_width="match_parent" android:layout_heigh
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ci_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
编辑:以下是两个设备的屏幕截图
这是手机:
这是平板电脑:
你为平板电脑创建了布局吗?@Hareshchelana是的,我已经将视图放在布局大文件夹中,几乎95%的视图都很好,只是我的浏览器是这样的,
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/BACKGROUND" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal" >
<ImageView
android:id="@+id/ci_info_big_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<ImageView
android:id="@+id/ci_info_prev"
android:layout_width="20dp"
android:layout_height="40dp"
android:layout_marginLeft="5dp"
android:src="@drawable/prev"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"/>
<HorizontalScrollView
android:id="@+id/ci_info_horizontal_sv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/SCROLL_VIEW_BACKGROUND" >
<LinearLayout
android:id="@+id/ci_info_small_image_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical" >
</LinearLayout>
</HorizontalScrollView>
<ImageView
android:id="@+id/ci_info_next"
android:layout_marginRight="5dp"
android:layout_width="20dp"
android:layout_height="40dp"
android:src="@drawable/next"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<mp1.com.widgets.FilledTextView
android:id="@+id/ci_info_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
<WebView
android:id="@+id/ci_info_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/BACKGROUND" >
<LinearLayout
android:id="@+id/ci_hotels_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/BACKGROUND" >
<LinearLayout
android:id="@+id/ci_wonders_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
public void onCreate(Bundle bundle)
{
super.onCreate(bundle);
setContentView(R.layout.ci_info_details);
setActionBarTitle(getResources().getString(R.string.TITLE_CI_DETAILS));
int id = getIntent().getExtras().getInt("id");
_viewPager = (ViewPager) findViewById(R.id.ci_pager);
_tabPagerAdapter = new Ci_CityDetailsAdapter(getSupportFragmentManager());
//async job fetching some info
Ci_InfoJob cij = new Ci_InfoJob(this, id);
cij.execute();
for (String tab_name : tabs) {
//I assume here's the problem ??? it's adding the tabs to actionbar...
_actionbar.addTab(_actionbar.newTab().setText(tab_name)
.setTabListener(this));
}
}