在android时钟应用程序图标中显示正确的模拟实时图标,甚至日历应用程序图标显示今天的日期。如何在应用程序中实现实时图标?
问问题
1549 次
1 回答
-1
您必须为此创建一个小部件应用程序,
https://developer.android.com/guide/topics/appwidgets#
理想情况下,您将与
<activity android:name=".ClockChoice">
</activity>
它由您的 xml 中的模拟时钟组成,例如
<?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"
tools:context=".MainActivity">
<AnalogClock
android:layout_marginTop="20dp"
android:layout_marginLeft="120dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
并且您在https://developer.android.com/guide/topics/appwidgets#文档之后添加小部件
于 2019-11-28T05:19:24.557 回答