To-do list resource example

Source: Internet
Author: User

To-do listResource example

 

In this example2ChapterTo-do listExampleProgramAdd new external resources to add some additional functions. The string and image resources created here will be in4Chapter:To-do listIt is used when the application implements the menu.

 

The next step will show you how to create text andIconResources, and how to create a topic for the application:

 

1.Create twoPNGTo add or delete items. It is best to estimate the size of each image.16 × 16Pixels, and Graphs3-5Same.

 

Figure3-5

 

2.Copy the image to the Project/RES/drawableFolder and update your project. Your engineering hierarchy should be shown in the figure3-6.

 

Figure3-6

 

3. open /RES/values string. XML resource file, which is " add_new "," remove "and" cancel " to add a string value. (You can delete the default " Hello " string .)

 

<? XML version = "1.0" encoding = "UTF-8"?>

<Resources>

<String name = "app_name"> to do list </string>

<String name = "add_new"> Add new item </string>

<String name = "remove"> remove item </string>

<String name = "cancel"> cancel </string>

</Resources>

 

4.In/RES/ValuesFolder to create a newStyles. xmlFile to create a new topic for the application. Let your topic be based onAndroidStandard topic, but set the default text size value.

 

<? XML version = "1.0" encoding = "UTF-8"?>

<Resources>

<Style name = "todotheme" parent = "@ Android: style/theme. Black">

<Item name = "Android: textsize"> 12sp </item>

</Style>

</Resources>

 

5.InManifestApplication topic in the file:

 

<Activity Android: Name = ". todolist"

Android: Label = "@ string/app_name"

Android: theme = "@ style/todotheme">

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.