نمایش نتایج 1 تا 4 از 4

نام تاپیک: نمایش پنجره دیالوگ

  1. #1
    کاربر دائمی آواتار abdoullah.aberi
    تاریخ عضویت
    آبان 1391
    محل زندگی
    بندرعباس
    پست
    166

    Post نمایش پنجره دیالوگ

    دوستان می خوام بدونم چجوری میشه یک پنجره دیالوگ در برنامه داشت دوستان لطفا راهنمایی کنین

  2. #2
    کاربر دائمی آواتار farhadfery
    تاریخ عضویت
    اردیبهشت 1387
    محل زندگی
    اصفهان
    پست
    723

    نقل قول: نمایش پنجره دیالوگ

    چندین نوع دیالوگ هست. این مثال را ببینید برای alert:
    http://www.mkyong.com/android/androi...ialog-example/
    برای کاستوم کردن:
    http://www.helloandroid.com/tutorial...id-application

  3. #3
    کاربر دائمی آواتار Modernidea
    تاریخ عضویت
    خرداد 1387
    محل زندگی
    »مشهد الرضا«
    پست
    573

    نقل قول: نمایش پنجره دیالوگ

    سلام

    اطلاعات کامل در مورد دیالوگ ها را میتوانید در این آدرس مطالعه کنید: http://developer.android.com/guide/t...i/dialogs.html

    این هم یک مثال:

    AlertDialogDemo Activity:

    package m.p.s;

    import android.app.Activity;
    import android.app.AlertDialog;
    import android.content.DialogInterface;
    import android.os.Bundle;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.Button;
    import android.widget.EditText;

    public class AlertDialogDemo extends Activity {
    Button btnGo;
    EditText txtMsg;
    String msg;

    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.dialog);
    txtMsg = (EditText)findViewById(R.id.txtMsg);

    btnGo = (Button) findViewById(R.id.btnGo);
    btnGo.setOnClickListener(new OnClickListener() {
    public void onClick(View arg0) {
    AlertDialog diaBox = makeAndShowDialogBox();

    diaBox.show();

    txtMsg.setText("I am here!");
    }

    });
    }//onCreate


    private AlertDialog makeAndShowDialogBox(){

    AlertDialog myQuittingDialogBox =

    new AlertDialog.Builder(this)
    //set message, title, and icon
    .setTitle("Terminator")
    .setMessage("Are you sure that you want to quit?")
    .setIcon(R.drawable.ic_launcher)

    //set three option buttons
    .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int whichButton) {
    //whatever should be done when answering "YES" goes here
    msg = "YES " + Integer.toString(whichButton);
    txtMsg.setText(msg);
    }
    })//setPositiveButton
    /* .setNeutralButton("Cancel", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int whichButton) {
    //whatever should be done when answering "NO" goes here
    msg = "Cancel " + Integer.toString(whichButton);
    txtMsg.setText(msg);
    }
    })*/


    .setNegativeButton("NO", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int whichButton) {
    //whatever should be done when answering "NO" goes here
    msg = "NO " + Integer.toString(whichButton);
    txtMsg.setText(msg);
    }
    })//setNegativeButton

    .create();

    return myQuittingDialogBox;
    }

    }//AndSelectionWidgets


    dialog.xml Layout:

    <LinearLayout
    android:id="@+id/LinearLayout01"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal">
    <Button
    android:text="GO"
    android:id="@+id/btnGo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
    </Button>
    <EditText
    android:hint="click the button"
    android:id="@+id/txtMsg"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    </EditText>

    </LinearLayout>

    منبع: http://www.java-samples.com/showtuto...utorialid=1513

  4. #4
    کاربر دائمی آواتار abdoullah.aberi
    تاریخ عضویت
    آبان 1391
    محل زندگی
    بندرعباس
    پست
    166

    نقل قول: نمایش پنجره دیالوگ

    مرسی از راهنمایی هایتون دوستان

تاپیک های مشابه

  1. سوال: نحوه نمایش یک فایل pdf بدون باز کردن پنجره دیالوگ باکس
    نوشته شده توسط msd4700 در بخش C#‎‎
    پاسخ: 15
    آخرین پست: دوشنبه 10 آبان 1395, 18:59 عصر
  2. نمایش پنجره ایی که پنجره صدا زننده اش را غیر فعال نمیکند
    نوشته شده توسط object در بخش کامپوننت های سایر شرکت ها، و توسعه کامپوننت
    پاسخ: 7
    آخرین پست: دوشنبه 14 خرداد 1386, 10:14 صبح
  3. نمایش پنجره
    نوشته شده توسط maryam_f در بخش طراحی وب (Web Design)
    پاسخ: 1
    آخرین پست: دوشنبه 20 فروردین 1386, 11:08 صبح
  4. نمایش یک دیالوگ برای انتخاب یک دایرکتوری ...
    نوشته شده توسط Mahmood_M در بخش برنامه نویسی در Delphi
    پاسخ: 5
    آخرین پست: جمعه 12 اسفند 1384, 10:56 صبح
  5. جلوگیری از نمایش پنجره ABOUT VSFLEXGRID
    نوشته شده توسط akram در بخش برنامه نویسی در 6 VB
    پاسخ: 3
    آخرین پست: یک شنبه 30 بهمن 1384, 20:25 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •