- 浏览: 1645430 次
文章分类
最新评论
-
sixinya:
............................... ...
数据适配器简介(Adapter) -
chenqidou:
...
CursorAdapter -
yw10260609:
问一下博主,对Winlicense的授权功能有没有了解,想了解 ...
Themida / Winlicense (TM / WL) 2.1.0.10 无key通过认证,对2.1.0.0或以下版本无KEY脱壳。 -
yw10260609:
[url][/url]
Themida / Winlicense (TM / WL) 2.1.0.10 无key通过认证,对2.1.0.0或以下版本无KEY脱壳。 -
yw10260609:
这么长啊!可惜基础的不是很会,有没有关于VMProtect加壳 ...
VMP (VMProtect)脱壳
Widgets高级篇(一)
前言
在Android3.0中,增加了大量的APP Widgets功能,在本文中将详细介绍它们。
一,设置预览图片在Android 3.0版本中,增加了
previewImage
属性,它用于指明
App Widget的预览图片,它将在用户选中该App Widget的图标,打算添加该App Widget时,进行显示,以便用户了解该App Widget的界面。如果没提供预览图标的话,显示的将是你的App Widget的启动图标。该属性和AndroidManifest.xml中的<receiver>元素的android:previewImage的属性一致。你可以在XML定义该属性,如示例1<wbr style="line-height:25px"><div style="line-height:25px"><span style="line-height:25px">示例1:</span></div>
<div style="line-height:25px">
<span style="line-height:normal; color:rgb(51,51,51); font-family:arial,sans-serif; font-size:13px"></span>
<pre style="line-height:inherit; color:rgb(0,112,0); font-family:monospace; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(204,204,204); border-right-color:rgb(204,204,204); border-bottom-color:rgb(204,204,204); border-left-color:rgb(204,204,204); background-color:rgb(250,250,250); padding-top:10px; padding-right:10px; padding-bottom:10px; padding-left:10px; margin-top:0px; margin-bottom:1em; margin-left:1em; overflow-x:auto; overflow-y:auto"><span style="line-height:23px; color:rgb(0,0,136)"><appwidget-provider</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(136,34,136)">xmlns:android</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"http://schemas.android.com/apk/res/android"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"> ...<br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:previewImage</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"@drawable/preview"</span><span style="line-height:23px; color:rgb(0,0,136)">></span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(0,0,136)"></appwidget-provider></span></pre>
</div>
<div style="line-height:25px">
<div style="line-height:25px"><span style="color:#000080; line-height:25px">Android emulator提供了一个叫做"Widget Preview"的APK应用程序,以便创建你的App Widgets的previewImage。</span></div>
<div style="line-height:25px">
<span style="color:#000080; line-height:25px">为了创建你的App Widgets的previewImage, 首先启动"Widget Preview"的这个应用程序, 然后选择需要制作previewImage的app widget,接着再按照提示在你的App Widget的Configuration Activity对其App Widget进行配置, 最后保存得到</span><span style="line-height:25px; color:rgb(0,0,128)">previewImage图片。</span>
</div>
</div>
<div style="line-height:25px">
<span style="line-height:25px">注意</span><span style="color:#000080; line-height:25px">:你可以在Android emulator的Application中,直接看到"Widget Preview"的这个</span><span style="color:#ff6600; line-height:25px">APK</span><span style="color:#000080; line-height:25px">应用程序,它的源码位于</span><span style="color:#0000ff; line-height:25px">android-sdk-windows\samples\android-12\WidgetPreview</span>目录下</div>
<div style="line-height:25px"><span style="line-height:25px"><span style="font-size:16px; line-height:28px">二,App Widgets中collection views简介</span></span></div>
<div style="line-height:25px">
<span style="line-height:25px; color:rgb(0,51,102)">在Android 3.0版本中,加入了可以进行数据集显示的App Widgets。这类App Widgets通过</span><span style="line-height:13px; color:rgb(0,112,0); font-family:monospace; font-size:13px"><a rel="nofollow" href="http://developer.android.com/reference/android/widget/RemoteViewsService.html" style="color:rgb(0,102,153); line-height:23px; text-decoration:none">RemoteViewsService</a></span><span style="line-height:25px; color:rgb(0,51,102)">来显示远程的数据集。</span>
</div>
<div style="line-height:25px">
<div style="line-height:25px; color:rgb(0,51,102)">App Widget通过RemoteViewsService提供的RemoteViewsFactory来进行数据集的显示。用于数据集显示的View,我们将称其为“集合视图"或“collection views”,它可以为以下类型之一:</div>
<div style="line-height:25px"><span style="line-height:25px">ListView</span></div>
<div style="line-height:25px"><span style="color:#000080; line-height:25px">该类view将以垂直可滚动列表的形式进行数据集中所有数据项的显示。最具代表性的是Gmail app widget</span></div>
<div style="line-height:25px"><span style="line-height:25px">GridView</span></div>
<div style="line-height:25px"><span style="color:#000080; line-height:25px">该view将以水平和垂直都可以滚动的grid(网格状)形式进行数据集中所有数据项的显示。最具代表性的是Bookmarks app widget</span></div>
<div style="line-height:25px"><span style="line-height:25px">StackView</span></div>
<div style="line-height:25px"><span style="color:#000080; line-height:25px">A stacked card view (kind of like a rolodex), 你可以对最前面一张card进行上翻(flick)/下翻(flick)来看到前一张/后一张 card,。最具代表性的是 YouTube and Books app widgets.</span></div>
<div style="line-height:25px"><span style="line-height:25px">AdapterViewFlipper</span></div>
<div style="line-height:25px"><span style="color:#000080; line-height:25px">An adapter-backed simple<a target="_blank" rel="nofollow" href="http://developer.android.com/reference/android/widget/ViewAnimator.html" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">ViewAnimator</a>that
animates between two or more views. Only one child is shown at a time.</span></div>
</div>
<div style="line-height:25px"><span style="color:#000080; line-height:25px">如上所述,这些collection views将显示由远程数据所组成的数据集合.这就意味着我们需要一个Adapter来把数据绑定到视图。</span></div>
<div style="line-height:25px">
<span style="color:#000080; line-height:25px">这个Adapter要负责把数据集的单个数据项和单个View对象进行绑定.</span><span style="color:#000080; line-height:25px">因为collection views是由adapters在后台提供的, 所以Android framework必须使用另外一种框架来支持在app widgets中使用它们</span>.<span style="color:#000080; line-height:25px">在app
widget应用中, 我们使用RemoteViewsFactory来代替Adapter , RemoteViewsFactory提供了和Adapter类似的接口.当请求数据集的一个数据项的时候,RemoteViewsFactory将以一个RemoteViews的形式返回数据集的一个数据项.为了在app widget中能使用collection view, 你必须实现一个<a target="_blank" rel="nofollow" href="http://developer.android.com/reference/android/widget/RemoteViewsService.html" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">RemoteViewsService</a>和<a target="_blank" rel="nofollow" href="http://developer.android.com/reference/android/widget/RemoteViewsService.RemoteViewsFactory.html" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">RemoteViewsFactory</a></span>
</div>
<div style="line-height:25px">
<div style="line-height:25px"><span style="color:#000080; line-height:25px">RemoteViewsService是一个service,远程的adapter可以通过它请求并获得RemoteViews对象.</span></div>
<div style="line-height:25px">
<span style="color:#0000ff; line-height:25px">RemoteViewsFactory</span><span style="color:#000080; line-height:25px">为collection view (such as</span><span style="color:#0000ff; line-height:25px">ListView</span><span style="color:#000080; line-height:25px">,</span><span style="color:#0000ff; line-height:25px">GridView</span><span style="color:#000080; line-height:25px">,
and so on)和collection view的数据提供了适配接口。</span>
</div>
<div style="line-height:25px"><span style="color:#000080; line-height:25px">这里是实现RemoteViewsService和其接口的一个代码样板:</span></div>
</div>
<div style="line-height:25px"><span style="line-height:25px">示例2</span></div>
<div style="line-height:25px">
<span style="line-height:normal; color:rgb(51,51,51); font-family:arial,sans-serif; font-size:13px"></span>
<pre style="line-height:inherit; color:rgb(0,112,0); font-family:monospace; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(204,204,204); border-right-color:rgb(204,204,204); border-bottom-color:rgb(204,204,204); border-left-color:rgb(204,204,204); background-color:rgb(250,250,250); padding-top:10px; padding-right:10px; padding-bottom:10px; padding-left:10px; margin-top:0px; margin-bottom:1em; margin-left:1em; overflow-x:auto; overflow-y:auto"><span style="line-height:23px; color:rgb(0,0,136)">public</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(0,0,136)">class</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(102,0,102)">StackWidgetService</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(0,0,136)">extends</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(102,0,102)">RemoteViewsService</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(102,102,0)">{</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(0,102,102)">@Override</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(0,0,136)">public</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(102,0,102)">RemoteViewsFactory</span><span style="line-height:23px; color:rgb(0,0,0)"> onGetViewFactory</span><span style="line-height:23px; color:rgb(102,102,0)">(</span><span style="line-height:23px; color:rgb(102,0,102)">Intent</span><span style="line-height:23px; color:rgb(0,0,0)"> intent</span><span style="line-height:23px; color:rgb(102,102,0)">)</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(102,102,0)">{</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(0,0,136)">return</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(0,0,136)">new</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(102,0,102)">StackRemoteViewsFactory</span><span style="line-height:23px; color:rgb(102,102,0)">(</span><span style="line-height:23px; color:rgb(0,0,136)">this</span><span style="line-height:23px; color:rgb(102,102,0)">.</span><span style="line-height:23px; color:rgb(0,0,0)">getApplicationContext</span><span style="line-height:23px; color:rgb(102,102,0)">(),</span><span style="line-height:23px; color:rgb(0,0,0)"> intent</span><span style="line-height:23px; color:rgb(102,102,0)">);</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(102,102,0)">}</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(102,102,0)">}</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(0,0,136)">class</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(102,0,102)">StackRemoteViewsFactory</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(0,0,136)">implements</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(102,0,102)">RemoteViewsService</span><span style="line-height:23px; color:rgb(102,102,0)">.</span><span style="line-height:23px; color:rgb(102,0,102)">RemoteViewsFactory</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(102,102,0)">{</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,0,0)">//... include adapter-like methods here. See the StackView Widget sample.</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(102,102,0)">}</span></pre>
</div>
<div style="line-height:25px"><span style="line-height:25px">例子程序</span></div>
<div style="line-height:25px"><span style="color:#000080; line-height:25px">以下是<a target="_blank" href="http://hubingforever.blog.163.com/blog/static/17104057920116293109787/" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">StackView Widget示例程序</a>的一个界面截图</span></div>
<div style="line-height:25px">
<span style="color:#000080; line-height:25px"></span>
<div style="line-height:25px"><img alt="Widgets高级篇(上) - hubingforever - 民主与科学" src="http://developer.android.com/resources/samples/images/StackWidget.png" style="line-height:25px; border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; max-width:100%; margin-top:0px; margin-right:10px; margin-bottom:0px; margin-left:0px"></div>
</div>
<div style="line-height:25px">
<div style="line-height:25px"><span style="color:#003366; line-height:25px">This sample consists of a stack of 10 views, which display the values "0!" through "9!" The sample app widget has these primary behaviors:</span></div>
<div style="line-height:25px; color:rgb(0,0,128)">
<span style="line-height:25px">首先</span>、The user can vertically fling the top view in the app widget to display the next or previous view. This is a built-in StackView behavior.</div>
<div style="line-height:25px">
<span style="line-height:25px; color:rgb(0,0,128)"><span style="line-height:25px">其次</span></span><span style="line-height:25px; color:rgb(0,0,128)">、</span><span style="color:#000080; line-height:25px">Without any user interaction,
the app widget automatically advances through its views in sequence, like a slide show. This is due to the setting</span><span style="color:#0000ff; line-height:25px">android:autoAdvanceViewId="@id/stack_view"</span><span style="color:#000080; line-height:25px">in
the</span><span style="color:#0000ff; line-height:25px">res/xml/stackwidgetinfo.xml</span><span style="color:#000080; line-height:25px">file. This setting applies to the view ID, which in this case is the view ID of the stack view.</span>
</div>
<div style="line-height:25px; color:rgb(0,0,128)">
<span style="line-height:25px">最后</span>、If the user touches the top view, the app widget displays the Toast message "Touched view n," where n is the index (position) of the touched view. For more discussion
of how this is implemented, see Adding behavior to individual items。</div>
</div>
<div style="line-height:25px; color:rgb(0,0,128)"><br style="line-height:25px"></div>
<div style="line-height:25px; color:rgb(0,0,128)">关于StackView Widget示例程序的相信内容请阅读《<strong><a title="阅读全文" target="_blank" href="http://hubingforever.blog.163.com/blog/static/17104057920116293109787/" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">StackView
Widget示例程序</a></strong>》</div>
<div style="line-height:25px"><span style="line-height:25px">三、Implementing app widgets with collections</span></div>
<div style="line-height:25px"><span style="color:#003366; line-height:25px">To implement an App Widget with collections, you follow the same basic steps you would use to implement any app widget. The following sections describe the additional steps you need
to perform to implement an App Widget with collections.</span></div>
<div style="line-height:25px"><span style="line-height:25px">3.1、Manifest for app widgets with collections</span></div>
<div style="line-height:25px"><span style="color:#000080; line-height:25px">In addition to the requirements listed in<a target="_blank" rel="nofollow" href="http://developer.android.com/guide/topics/appwidgets/index.html#Manifest" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">Declaring
an App Widget in the Manifest</a>, to make it possible for App Widgets with collections to bind to your RemoteViewsService, you must declare the service in your manifest file with the permission<a target="_blank" rel="nofollow" href="http://developer.android.com/reference/android/Manifest.permission.html#BIND_REMOTEVIEWS" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">BIND_REMOTEVIEWS</a>.
This prevents other applications from freely accessing your app widget's data. For example, when creating an App Widget that uses RemoteViewsService to populate a collection view, the manifest entry may look like this:</span></div>
<div style="line-height:25px">
<span style="line-height:normal; color:rgb(51,51,51); font-family:arial,sans-serif; font-size:13px"></span>
<pre style="line-height:inherit; color:rgb(0,112,0); font-family:monospace; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(204,204,204); border-right-color:rgb(204,204,204); border-bottom-color:rgb(204,204,204); border-left-color:rgb(204,204,204); background-color:rgb(250,250,250); padding-top:10px; padding-right:10px; padding-bottom:10px; padding-left:10px; margin-top:0px; margin-bottom:1em; margin-left:1em; overflow-x:auto; overflow-y:auto"><span style="line-height:23px; color:rgb(0,0,136)"><service</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(136,34,136)">android:name</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"MyWidgetService"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px">...<br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:permission</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"android.permission.BIND_REMOTEVIEWS"</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(0,0,136)">/></span></pre>
</div>
<div style="line-height:25px"><span style="color:#000080; line-height:25px">这里的android:name="MyWidgetService" 是就你的RemoteViewsService.</span></div>
<div style="line-height:25px"><span style="line-height:25px">3.2、Layout for app widgets with collections</span></div>
<div style="line-height:25px">
<div style="line-height:25px"><span style="color:#003366; line-height:25px">你的app widget的布局文件应该包括下面之一的 collection views: ListView, GridView, StackView, or AdapterViewFlipper.</span></div>
<div style="line-height:25px">
<span style="color:#003366; line-height:25px">下面就是<a target="_blank" href="http://hubingforever.blog.163.com/blog/static/17104057920116293109787/" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">StackView
Widget示例程序</a>的布局文件widget_layout.xml</span><span style="color:#000080; line-height:25px">:</span>
</div>
</div>
<div style="line-height:25px"><span style="line-height:25px">示例3</span></div>
<div style="line-height:25px">
<span style="line-height:normal; color:rgb(51,51,51); font-family:arial,sans-serif; font-size:13px"></span>
<pre style="line-height:inherit; color:rgb(0,112,0); font-family:monospace; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(204,204,204); border-right-color:rgb(204,204,204); border-bottom-color:rgb(204,204,204); border-left-color:rgb(204,204,204); background-color:rgb(250,250,250); padding-top:10px; padding-right:10px; padding-bottom:10px; padding-left:10px; margin-top:0px; margin-bottom:1em; margin-left:1em; overflow-x:auto; overflow-y:auto"><span style="line-height:23px; color:rgb(102,102,0)"><?</span><span style="line-height:23px; color:rgb(0,0,0)">xml version</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"1.0"</span><span style="line-height:23px; color:rgb(0,0,0)"> encoding</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"utf-8"</span><span style="line-height:23px; color:rgb(102,102,0)">?></span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(0,0,136)"><FrameLayout</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(136,34,136)">xmlns:android</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"http://schemas.android.com/apk/res/android"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:layout_width</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"match_parent"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:layout_height</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"match_parent"</span><span style="line-height:23px; color:rgb(0,0,136)">></span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(0,0,136)"><StackView</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(136,34,136)">xmlns:android</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"http://schemas.android.com/apk/res/android"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:id</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"@+id/stack_view"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:layout_width</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"match_parent"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:layout_height</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"match_parent"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:gravity</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"center"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:loopViews</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"true"</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(0,0,136)">/></span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(0,0,136)"><TextView</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(136,34,136)">xmlns:android</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"http://schemas.android.com/apk/res/android"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:id</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"@+id/empty_view"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:layout_width</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"match_parent"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:layout_height</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"match_parent"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:gravity</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"center"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:background</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"@drawable/widget_item_background"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:textColor</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"#ffffff"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:textStyle</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"bold"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:text</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"@string/empty_view_text"</span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(136,34,136)">android:textSize</span><span style="line-height:23px; color:rgb(102,102,0)">=</span><span style="line-height:23px; color:rgb(0,136,0)">"20sp"</span><span style="line-height:23px; color:rgb(0,0,0)"> </span><span style="line-height:23px; color:rgb(0,0,136)">/></span><span style="line-height:23px; color:rgb(0,0,0)"><br style="line-height:23px"></span><span style="line-height:23px; color:rgb(0,0,136)"></FrameLayout></span></pre>
</div>
<div style="line-height:25px">
<div style="line-height:25px">
<span style="line-height:25px">注意</span><span style="color:#000080; line-height:25px">:</span>empty views是在collection view为空(数据集为空)的时候,显示的view.关于次的更多内容,你将在后文看到。</div>
<div style="line-height:25px; color:rgb(0,0,128)">除了这个布局文件,你改要编写另外的布局文件,以用于数据项的View布局。比如,在<a target="_blank" href="http://hubingforever.blog.163.com/blog/static/17104057920116293109787/" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">StackView
Widget示例程序</a>中它只有一个用于数据项显示的View布局的文件, widget_item.xml。而在WeatherList Widget示例程序中,它只有两个用于数据项显示的View布局的文件: dark_widget_item.xml和light_widget_item.xml</div>
</div>
</wbr>
相关推荐
SWT widgets的基本教程。doc
Qt5Widgets,QT 所需的运行库
http://platform.twitter.com/widgets.js
Sheridan Data Widgets 3.1 注册版
Mi-widgets框架Mi-widgets框架
UIWidgets 是unity 最新的,最好用,开元的一个unity插件,希望大家下载学习下
New UI Widgets 是一款不错的GUI插件,可以供各大项目使用 里面包含各种不同的空间,比如下拉列表框,输入框等等
BREW UI Widgets OEM_Cust_Gd
Laravel开发-widgets Laravel 5小部件
Android 电量显示Widgets,可以显示当前的系统的电量。
Android-Widgets-Spinners
Laravel开发-laravel-widgets 用于在Laravel-5中使用小部件的包
Qt widgets-基本控件使用示例,不使用控件拖动,采用代码layout完成控件排布。 BasicLayout Basic Layouts shows how to use the standard layout managers that are available in Qt: QBoxLayout, QGridLayout, and...
Widgets for new UI: Collections: - Combobox - ListView - TileView - TreeView - DirectoryTreeView * - FileListView * Widgets can be generated for the your custom type with context menu "Create / New UI...
A set of the widgets and interactions for Unity UI and widgets generator for your custom data types. Collections: - Combobox - ListView - TileView - TreeView - DirectoryTreeView * - ...
New UI Widgets是一组窗口小部件和UI交互。它还包括用于自定义数据类型的小部件生成器,以及从默认Text到TextMeshPro的转换器。
QWT,即Qt Widgets for Technical Applications,是一个基于LGPL版权协议的开源项目, 可生成各种统计图,是为具有技术专业背景的程序提供GUI组件和一组实用类,其目标是以基于2D方式的窗体部件来显示数据, 数据源...
打开 widgets.pro,添加:TRANSLATIONS += widgets.ts,在 Qt Creator 的系统菜单中,选择:工具 -> 外部 -> Qt语言家 -> 更新翻译(lupdate),就会在 widgets.pro 所在目录下生成一个 widgets.ts 文件。...
ugui New UI Widgets is a set of widgets and UI interactions; it also includes a widgets generator for the custom data types and converter from default Text to TextMeshPro. Demo:...