Java-android Study (fifth day)

Source: Internet
Author: User

Android layout pick up Shell + page Jump One, Android layout pick up the bay

These two days in the interface layout of the supplement (may be added in the future):

a), ScrollView

ScrollView (scrolling view) is a view that needs to be displayed by a scrolling axis when there is a lot of content and the screen is not displayed, ScrollView only supports vertical scrolling;

This view is a good choice when there are more columns at the bar level.

b), View

We want to divide a region into different sub-regions, and there is a distinct division between the regions (can be a split line, or it can be a certain height of the segmented area),

Then using <View/> is a good choice, using the example below:

<view
Android:layout_width= "Fill_parent"
android:layout_height= "20SP"//Set height, indicating the height of the grayscale area, the line character is rendered when the value is set to 1SP, the effect of delimiter
android:layout_margintop= "14SP"
android:background= "#fff7f7f7"/>

Second, page jump

In general, the implementation of page jumps, mainly consider the following several processes:

A), add a click event to the control

Scenario: There are two interfaces A, B, there is a button btn in interface A, you need to click BTN Jump to Interface B.

In a class that implements Activty (sometimes in order to differentiate between different controls, perhaps to implement Onclicklistener),

①, define a private Button Btntz = null;

②, in the OnCreate method, btntz= (Button) Findviewbyid (R.id.btntz); Gets the mapping object for the button;

③, Associate the button's Click event listener to the specific implementation method:

Btntz.setonclicklistener (this);
public void OnClick (View v) {//Some processing logic, then a specific jump}

Or

Btnclassspace.setonclicklistener (New Onclicklistener () {@Override public void oncli CK (View v) {//specific jump
}                });
b), the specific jump
Intent Intent = new Intent (digitalschoolactivity.this,webviewactivty.class); Webviewmodel ViewModel = new Webviewmodel (title, Uri), Intent.putextra ("Webviewmodel", ViewModel); StartActivity ( Intent);

Java-android Study (fifth day)

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.