Android Learning image operation and time date selector

Source: Internet
Author: User

First, basic learning

1.ImageView is a picture container, just like Radiogroup is a RadioButton container, is the direct subclass of view.

1 <imageviewandroid:id="@+id/img" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/logo"></imageview>
1 <imageview android:id="@+id/img"android:layout_width="fill_parent" android:layout_height="wrap_content"android:src="@drawable/logo"></imageview>
  1: <imageview
  
  3:android:layout_width= "Fill_parent"
  
  5:android:src= "@drawable/logo"/>


just remember that the picture is on the res/drawable-xxx.
2.ImageButton (Picture button) and button It's okay, he's an extension of ImageView, it's a subclass, and the button is a subclass of TextView.

  1: <imagebutton
  
  3:android:layout_width= "Wrap_content"
  
  5:android:src= "@drawable/right"/>

3.TimePicker time Selector, a direct subclass of Framelayout (positive layout), default 12 hours
4. What is the principle of data recovery, in other words, the data can be retrieved after being deleted again, I wonder if the data is not really deleted (the disk with the smaller, guess), just remove the corresponding link, just can't find it, restore the data is to restore the link.
That's not right, because the recovered data is not directly on the original disk, which I am surprised. Now everything is ready-made, direct fool software One-click Recovery, then you say the principle of learning what is the use.

Second, the case analysis

1.TimePicker

  1:package Org.lxh.demo;
  
  3:import android.app.Activity;
  4:import Android.os.Bundle;
  5:import Android.widget.TimePicker;
  
  7:public class Mytimepicker extends Activity {
  8:private Timepicker MYTP = null;
  9:/*
Ten:  * The first is the default time to get the system
One:  * The second is to write your own death
*/  
: @Override
15:public void OnCreate (Bundle savedinstancestate) {
16:super.oncreate (savedinstancestate);
17:super.setcontentview (R.layout.main);
18:THIS.MYTP = (timepicker) Super.findviewbyid (R.ID.TP2);//Get Components
19:this.mytp.setis24hourview (TRUE);//set to 24-hour system
20:this.mytp.setcurrenthour (18);//When Set
21:this.mytp.setcurrentminute (30);//Set points
22:}
23:}
Main.xml

2.DatePicker

As above, do not repeat.

Android Learning image operation and time date selector

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.