<legend id='p9N7u'><style id='p9N7u'><dir id='p9N7u'><q id='p9N7u'></q></dir></style></legend>
  1. <i id='p9N7u'><tr id='p9N7u'><dt id='p9N7u'><q id='p9N7u'><span id='p9N7u'><b id='p9N7u'><form id='p9N7u'><ins id='p9N7u'></ins><ul id='p9N7u'></ul><sub id='p9N7u'></sub></form><legend id='p9N7u'></legend><bdo id='p9N7u'><pre id='p9N7u'><center id='p9N7u'></center></pre></bdo></b><th id='p9N7u'></th></span></q></dt></tr></i><div id='p9N7u'><tfoot id='p9N7u'></tfoot><dl id='p9N7u'><fieldset id='p9N7u'></fieldset></dl></div>
    <tfoot id='p9N7u'></tfoot>

    1. <small id='p9N7u'></small><noframes id='p9N7u'>

        <bdo id='p9N7u'></bdo><ul id='p9N7u'></ul>
    2. Android ViewPager 维度

      Android ViewPager dimension(Android ViewPager 维度)
      <legend id='rhu8G'><style id='rhu8G'><dir id='rhu8G'><q id='rhu8G'></q></dir></style></legend>

          <tbody id='rhu8G'></tbody>
            <bdo id='rhu8G'></bdo><ul id='rhu8G'></ul>
          • <small id='rhu8G'></small><noframes id='rhu8G'>

              1. <tfoot id='rhu8G'></tfoot>

                <i id='rhu8G'><tr id='rhu8G'><dt id='rhu8G'><q id='rhu8G'><span id='rhu8G'><b id='rhu8G'><form id='rhu8G'><ins id='rhu8G'></ins><ul id='rhu8G'></ul><sub id='rhu8G'></sub></form><legend id='rhu8G'></legend><bdo id='rhu8G'><pre id='rhu8G'><center id='rhu8G'></center></pre></bdo></b><th id='rhu8G'></th></span></q></dt></tr></i><div id='rhu8G'><tfoot id='rhu8G'></tfoot><dl id='rhu8G'><fieldset id='rhu8G'></fieldset></dl></div>
                本文介绍了Android ViewPager 维度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                ViewPager 是否必须是活动布局中唯一存在的对象?我正在尝试实现这样的东西:

                Does the ViewPager have to be the only object present inside the activity layout? I'm trying to implement something like this:

                <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/reader_layout"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="vertical" >
                
                <android.support.v4.view.ViewPager
                    android:id="@+id/page_viewer"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
                
                <Gallery
                    android:id="@+id/miniatures_gallery"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" /></LinearLayout>
                

                我应该在哪里有一个在顶部滚动的大寻呼机(我有它)和一个较小的画廊在它下面滚动.这仅显示寻呼机而不显示图库.有什么建议吗?

                Where should I have a big pager scrolling in the top (and I have it) and a smaller gallery scrolling under that. This shows me only the pager and not the gallery. Any suggestion?

                推荐答案

                ViewPager 不支持 wrap_content 因为它(通常)永远不会同时加载所有子项,因此不能获得适当的大小(选项是让寻呼机在每次切换页面时都会改变大小).

                The ViewPager does not support wrap_content as it (usually) never have all its children loaded at the same time, and can therefore not get an appropriate size (the option would be to have a pager that changes size every time you have switched page).

                但是,您可以设置精确的尺寸(例如 150dp),match_parent 也可以.
                您还可以通过更改 LayoutParams 中的 height 属性从代码中动态修改尺寸.

                You can however set a precise dimension (e.g. 150dp) and match_parent works as well.
                You can also modify the dimensions dynamically from your code by changing the height-attribute in its LayoutParams.

                这篇关于Android ViewPager 维度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
                cocos2d-android: how to display score(cocos2d-android:如何显示分数)
                Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
                SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
                Android file copy(安卓文件拷贝)
                Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)
                <legend id='xD5Ni'><style id='xD5Ni'><dir id='xD5Ni'><q id='xD5Ni'></q></dir></style></legend>
              2. <small id='xD5Ni'></small><noframes id='xD5Ni'>

                  • <i id='xD5Ni'><tr id='xD5Ni'><dt id='xD5Ni'><q id='xD5Ni'><span id='xD5Ni'><b id='xD5Ni'><form id='xD5Ni'><ins id='xD5Ni'></ins><ul id='xD5Ni'></ul><sub id='xD5Ni'></sub></form><legend id='xD5Ni'></legend><bdo id='xD5Ni'><pre id='xD5Ni'><center id='xD5Ni'></center></pre></bdo></b><th id='xD5Ni'></th></span></q></dt></tr></i><div id='xD5Ni'><tfoot id='xD5Ni'></tfoot><dl id='xD5Ni'><fieldset id='xD5Ni'></fieldset></dl></div>

                          <tbody id='xD5Ni'></tbody>

                        <tfoot id='xD5Ni'></tfoot>
                          <bdo id='xD5Ni'></bdo><ul id='xD5Ni'></ul>