<small id='A3Nnx'></small><noframes id='A3Nnx'>

      <legend id='A3Nnx'><style id='A3Nnx'><dir id='A3Nnx'><q id='A3Nnx'></q></dir></style></legend>
    1. <tfoot id='A3Nnx'></tfoot>

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

        • <bdo id='A3Nnx'></bdo><ul id='A3Nnx'></ul>

        App Widget:您可以指定最小和默认大小吗?

        时间:2023-09-08
        • <legend id='Wef8s'><style id='Wef8s'><dir id='Wef8s'><q id='Wef8s'></q></dir></style></legend>

          <small id='Wef8s'></small><noframes id='Wef8s'>

        • <tfoot id='Wef8s'></tfoot>

              <tbody id='Wef8s'></tbody>

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

                  <bdo id='Wef8s'></bdo><ul id='Wef8s'></ul>
                  本文介绍了App Widget:您可以指定最小和默认大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当您设计应用小部件时,您需要指定该小部件的最小宽度和高度.当用户放置一个新的小部件时,最小宽度和高度似乎转换为默认的小部件大小(以块为单位).

                  When you design an app widget, you specify a minimum width and height for that widget. When the user places a new widget, the minimum width and height appear to translate across to a default widget size (in terms of blocks).

                  换句话说,初始小部件布局似乎与指定的最小小部件大小相对应(他们可以随后调整大小).

                  In other words, the initial widget layout appears to correspond to the minimum widget size specified (which they can subsequently resize).

                  是否可以指定您希望小部件最初按照默认大小布局,同时还设置用户以后无法调整小部件大小的最小尺寸?

                  Is it possible to specify that you want the widget initially to be laid out according a default size, whilst also setting the minimum dimensions below which the user cannot resize the widget later?

                  在我的例子中,有一个我认为小部件看起来最好的尺寸,但如果用户真的想节省空间,它看起来仍然可以低于该尺寸.所以我想将默认值设置为我认为最好的值,并将最小值设置为真正的下限.

                  In my case, there is a size at which I think the widget looks best, but it still looks OK below that size if the user really wants to save on space. So I want to set the default at what I think looks best, and the minimum at what truly is the lower limit.

                  推荐答案

                  这是正确的 - 在您可以使用的应用小部件提供程序信息的元数据定义中

                  That is correct - in the metadata definition of for your app widget provider info you can use

                  minWidthminHeight 来定义您想要/默认/最佳的小部件尺寸和minResizeWidthminResizeHeight 定义允许的最小小部件尺寸

                  minWidth and minHeight to define your desired / default / best widget size and minResizeWidth and minResizeHeight to define the smallest allowed widget size

                  例如:

                  <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
                    android:minWidth="286.0dp"
                    android:minHeight="146.0dp"
                    android:resizeMode="vertical|horizontal"
                    android:minResizeWidth="146.0dp"
                    android:minResizeHeight="72.0dp"
                  />
                  

                  在这种情况下,默认大小为 4 x 2 单元格,最小大小为 2 x 1

                  In this case the default size is 4 x 2 cells, and the minimum size is 2 x 1

                  这篇关于App Widget:您可以指定最小和默认大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Android - 在小部件中使用自定义视图 下一篇:在 Android 2 (API 5) 中模拟堆栈视图?

                  相关文章

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

                  <legend id='Dbtgj'><style id='Dbtgj'><dir id='Dbtgj'><q id='Dbtgj'></q></dir></style></legend>
                    <bdo id='Dbtgj'></bdo><ul id='Dbtgj'></ul>

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