Android Layout Binder (an online tool for creating Java code with view Find in XML)

Source: Internet
Author: User

Nonsense not much to say, this is address: http://android.lineten.net/layout.php.


There is a picture of the truth, such as:



If this is the case with your XML:


<?xml version= "1.0" encoding= "Utf-8"?>
<relativelayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Fill_parent"
android:layout_height= "Fill_parent"
android:orientation= "Vertical" >


<imageview
Android:id= "@+id/logo"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
android:background= "@drawable/ic_logo"/>


<button
Android:id= "@+id/version_btn"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:layout_below= "@id/logo"
Android:layout_centerhorizontal= "true"
android:layout_margintop= "@dimen/dp_54"
Android:textcolor= "@color/colffffff"
Android:textsize= "18SP"
Android:text= "version number: 1.0.0"
android:background= "@drawable/bg_version_btn"/>


<textview
Android:id= "@+id/companyname_tv"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_alignparentbottom= "true"
Android:layout_centerhorizontal= "true"
android:background= "@color/transparent"
android:text= "@string/companyname"
Android:textcolor= "@color/col8d8d8d"
android:layout_marginbottom= "@dimen/font_size_40"
Android:textsize= "14sp"/>


<textview
Android:id= "@+id/email_tv"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_alignparentbottom= "true"
Android:layout_centerhorizontal= "true"
android:layout_marginbottom= "@dimen/dp_22"
android:text= "Email: [Email protected]"
Android:textcolor= "@color/cola0a0a0"
/>
</RelativeLayout>


Generate code such as the following:
Content View Elements

Private ImageView Mlogo;
Private Button mversion_btn;
Private TextView Mcompanyname_tv;
Private TextView Memail_tv;

End of Content View Elements

private void Bindviews () {

Mlogo = (ImageView) Findviewbyid (R.id.logo);
MVERSION_BTN = (Button) Findviewbyid (R.ID.VERSION_BTN);
MCOMPANYNAME_TV = (TextView) Findviewbyid (R.ID.COMPANYNAME_TV);
MEMAIL_TV = (TextView) Findviewbyid (R.ID.EMAIL_TV);
}





Android Layout Binder (an online tool for creating Java code with view Find in XML)

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.