我希望ViewPager全屏 - Android Studio

时间:2016-03-26 08:22:21

标签: android android-viewpager

我在使用json.dumps(parsed_price_data) 时遇到了一些问题。我想让它全屏显示,但由于某种原因,有一些边缘不会消失。我该如何解决这个问题?

ViewPager - 文件

中的代码
XML

enter image description here

4 个答案:

答案 0 :(得分:1)

你可以试试这个:

android:layout_width="fill_parent"
android:layout_height="wrap_content"

答案 1 :(得分:0)

尝试从四个方向移除填充。默认情况下,使用AS创建活动时,AS会向主视图添加填充。下面是没有外部填充的布局。

REVOKE ALL PRIVILEGES ON SCHEMA pg_catalog FROM newrole;
REVOKE ALL PRIVILEGES ON SCHEMA pg_catalog FROM public;
REVOKE ALL PRIVILEGES ON SCHEMA information_schema FROM newrole;
REVOKE ALL PRIVILEGES ON SCHEMA information_schema FROM public;

答案 2 :(得分:0)

您可以尝试以下方式

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".Main.MainActivity"
tools:showIn="@layout/activity_main">

<android.support.v4.view.ViewPager
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/viewPager"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true" />

答案 3 :(得分:0)

从RelativeLayout中删除所有android:padding 并删除android:layout_centerVertical和android:layout_centerHorizo​​ntal 来自ViewPager