There are four ways to implement the composite controls of image and text. The first method is to use Gallery.
Part 1: Create a layout file to add text to images. The name is pic_text.xml and the content is:
Part 2: Layout file of the entire program, that is, a gallery:
Part 3: Main Program:
Package Yan. guoqi. testgallery; import android. app. activity; import
, do not leave me a message or send an email asking me for the source code, but it is estimated that many people did not have the patience to complete the reading, and sent an email to ask me for the source code. I had to wash my ass, prepare to go to bed, and open the computer to email back ].
The following is the rewritten gallery code. The comments are basically written.Mygallery. Java:
/*** Mygallery. Java * @ version 1.0 * @ author haven http://
. This is an optional activity. When you add an app widget, it is loaded and allowed to modify the settings of the app widget during creation.
The following sections describe how to create these components:
Declare An application widget in the list
First, declare the appwidgetprovider class in the androidmanifest. xml file of the application, for example:
The
This example describes the Android Desktop plugin app widget usage. Share to everyone for your reference, specific as follows:
application window Widget App Widgets
The application window widget (widget) is a tiny application view that can be embedded in other applications
, generate the corresponding imageview array, and finally return it in getview.
/*
* Copyright (c) 2010 Neil Davies
*
* Licensed under the Apache license, version 2.0 (the "License ");
* You may not use this file before t in compliance with the license.
* You may obtain a copy of the license
*
* Http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* Distributed under the license is distributed on an "as is" basis,
* Witho
) findViewById(R.id.activity_01_galleryFlow);galleryFlow.setAdapter(adapter);}}
Gallery is an android Image Browsing component (not just an image, you can use an adapter). The Chinese meaning of Gallery is also the meaning of the Gallery, which means to arrange the image in a row and then slide it manually. This articl
Reference address: http://mobile.51cto.com/widget-290079.htm
Ndroid widget DevelopmentCase implementation is the content to be introduced in this article, mainly to understand and learnAndroid widget DevelopmentApplication. Let's write about it today.Android widgetOfDevelopmentBecause it's time to wait early in the morning, I won't say it's too specific. Let
Learn android
The Gallery component can display images in the Gallery. Play images cyclically in the gallery
The inheritance structure is as follows:
Java. lang. Object
Bytes
Android. view. View
Bytes
This article focuses on the concept of Widget development. In this example, we want to develop a Widget on the mobile Android platform. The content of this Widget is obtained from the official website based on the input account. Of course, this process requires an API to process and display the information after obtain
Objective
This is the main implementation of an Android application, static broadcast, dynamic broadcast two ways to change the content of the widget, that is, in the blog on the basis of the experiment to modify, so the focus of this experiment is the realization of appwidget small parts ~
First, let's simply say what the widget is.
The application window
App widgets are also a UI component that can embed a small program (program piece) into the desktop. Compared with common widgets (such as TextView and WebView), the following differences exist:
An App Widget is a live UI component that automatically updates its content;Widgets cannot automatically update their own content and can only passively wait for user calls;In applications, because of the automatic update feature of App widgets, it is suitable
Res/values/attrs.xml. */Mgalleryitembackground = A.getresourceid (r.styleable.gaLlery_android_galleryitembackground, 0); * Obtain the Gallery attribute of index a.recycle ();/* Make the Styleable property of the OBJECT reusable */} public int GetCount ()/* must be overridden by the party Method GetCount, the total number of pictures returned */{//return myimageids.length; return integer.max_value; } public Object GetItem (int position)/* m
The gallery component, known as a gallery, is a list of landscape views, and when using Android API Platform, Gallery is painted with a dash to indicate that Google has deprecated the component.* @deprecated This widget is no longer supported. Other horizontally scrolling* W
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.