Dialog popup box, customize the layout inside;

Source: Internet
Author: User

The settings inside the code, click the Trigger Popup dialog box;

 CaseR.id.re_ps://Delivery feeFinal Dialog Dialog1 =NewDialog ( This); View ContentView1= Layoutinflater. from( This). Inflate (R.layout.activity_send_peisong,NULL);d Ialog1.setcontentview (contentView1);d Ialog1.settitle ("Delivery fee");d Ialog1.setcanceledontouchoutside (true); SeekBar=(SeekBar) Contentview1.findviewbyid (R.ID.SEEKBAR11); Num_tv=(TextView) Contentview1.findviewbyid (R.ID.NUM_TV); Button price_cancle=(Button) Contentview1.findviewbyid (r.id.s_cancel); Button price_true=(Button) Contentview1.findviewbyid (R.ID.S_OK);p Rice_true.setonclicklistener (NewOnclicklistener () { Public voidOnClick (View v) {//TODO auto-generated Method StubTextview_fy.settext (Numbers +"Yuan");d Ialog1.dismiss ();}}); Price_cancle.setonclicklistener (NewOnclicklistener () { Public voidOnClick (View v) {//TODO auto-generated Method StubDialog1.dismiss ();}}); Dialog1.show (); initseekbarprogress (); Break;

XML layout;

<?xml version="1.0"encoding="Utf-8"? ><relativelayout xmlns:android="http://schemas.android.com/apk/res/android"Android:id="@+id/ps"Android:layout_width="fill_parent"Android:layout_height="fill_parent"Android:background="#ffffff"android:orientation="Vertical"> <LinearLayout android:layout_margintop="20px"Android:id="@+id/linearlayout1"Android:layout_width="fill_parent"Android:layout_height="wrap_content"Android:layout_alignparentleft="true"Android:layout_alignparenttop="true"android:orientation="Vertical"> <TextView Android:id="@+id/num_tv"Android:layout_width="wrap_content"Android:layout_height="wrap_content"Android:background="@drawable/publish_seekbar_dialog"android:gravity="Center_horizontal"Android:paddingtop="1DP"Android:text="0"Android:textcolor="#ffffff"/> <SeekBar Android:id="@+id/seekbar11"Android:layout_width="match_parent"Android:layout_height="wrap_content"Android:layout_marginbottom="50px"Android:max=" -"android:progress="0"android:progressdrawable="@drawable/seekbar_img"Android:thumb="@drawable/thumb"/> </LinearLayout><relativelayout android:layout_width="match_parent"Android:layout_height="wrap_content"Android:layout_margintop="50px"Android:layout_marginbottom="50px"Android:layout_alignparentleft="true"Android:layout_below="@+id/linearlayout1"> <Button Android:id="@+id/s_cancel"Android:layout_width="100px"Android:layout_height="wrap_content"android:layout_centervertical="true"Android:layout_marginright="55DP"Android:layout_toleftof="@+id/s_ok"Android:background="@drawable/dialog_btn_right_checked"Android:text="Cancel"/> <Button Android:id="@+id/s_ok"Android:layout_width="100px"Android:layout_height="wrap_content"Android:layout_alignbaseline="@+id/s_cancel"Android:layout_alignbottom="@+id/s_cancel"Android:layout_alignparentright="true"Android:layout_marginright="80DP"Android:background="@drawable/dialog_btn_right_checked"Android:text="Confirm"/> </RelativeLayout></RelativeLayout>

Dialog popup box, customize the layout inside;

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.