久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <i id='wqNJW'><tr id='wqNJW'><dt id='wqNJW'><q id='wqNJW'><span id='wqNJW'><b id='wqNJW'><form id='wqNJW'><ins id='wqNJW'></ins><ul id='wqNJW'></ul><sub id='wqNJW'></sub></form><legend id='wqNJW'></legend><bdo id='wqNJW'><pre id='wqNJW'><center id='wqNJW'></center></pre></bdo></b><th id='wqNJW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='wqNJW'><tfoot id='wqNJW'></tfoot><dl id='wqNJW'><fieldset id='wqNJW'></fieldset></dl></div>

    <legend id='wqNJW'><style id='wqNJW'><dir id='wqNJW'><q id='wqNJW'></q></dir></style></legend>

    <small id='wqNJW'></small><noframes id='wqNJW'>

    <tfoot id='wqNJW'></tfoot>

    • <bdo id='wqNJW'></bdo><ul id='wqNJW'></ul>

      如何在警報(bào)對話框中放置搜索欄?

      How do I put a seek bar in an alert dialog?(如何在警報(bào)對話框中放置搜索欄?)

        • <legend id='uExtW'><style id='uExtW'><dir id='uExtW'><q id='uExtW'></q></dir></style></legend>

            <small id='uExtW'></small><noframes id='uExtW'>

            <i id='uExtW'><tr id='uExtW'><dt id='uExtW'><q id='uExtW'><span id='uExtW'><b id='uExtW'><form id='uExtW'><ins id='uExtW'></ins><ul id='uExtW'></ul><sub id='uExtW'></sub></form><legend id='uExtW'></legend><bdo id='uExtW'><pre id='uExtW'><center id='uExtW'></center></pre></bdo></b><th id='uExtW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uExtW'><tfoot id='uExtW'></tfoot><dl id='uExtW'><fieldset id='uExtW'></fieldset></dl></div>
              <tbody id='uExtW'></tbody>
            • <tfoot id='uExtW'></tfoot>
              • <bdo id='uExtW'></bdo><ul id='uExtW'></ul>
                本文介紹了如何在警報(bào)對話框中放置搜索欄?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我希望在單擊按鈕后彈出一個(gè)警告對話框以顯示搜索欄,以便人們可以將值從 1 更改為 48.我制作了一個(gè)自定義 xml,它有一個(gè)搜索欄和兩個(gè)文本視圖,我希望對話框有兩個(gè)按鈕,一個(gè)只是取消對話框,另一個(gè)做更多的工作.這是我到目前為止的代碼.

                I want an alert dialog box to pop up after I click a button to have a seek bar so that the person can change the value from 1-48. I've made a custom xml that has a seek bar and two text view and I would like the dialog box to have two buttons, one just cancels the dialog and the other does more work. Here is the code I have so far.

                  <?xml version="1.0" encoding="utf-8"?>
                <RelativeLayout
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  android:orientation="vertical"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent">
                    <SeekBar android:max="48" android:layout_height="wrap_content" android:id="@+id/seekBar1" android:layout_width="fill_parent" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_marginTop="74dp"></SeekBar>
                    <TextView android:text="Change Hour Range" android:layout_height="wrap_content" android:id="@+id/textView1" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true"></TextView>
                    <TextView android:text="Only most recent positions" android:layout_height="wrap_content" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_below="@+id/textView1" android:layout_centerHorizontal="true" android:layout_marginTop="15dp"></TextView>
                
                </RelativeLayout>
                

                這是我目前看到的警報(bào)對話框

                Here is the alert dialog that I have so far

                new AlertDialog.Builder(ImTracking.this)
                                    //is there something like setcontentview for alert dialogs?
                
                                    .setPositiveButton("Cancel", null)
                                    .setNegativeButton("OK",
                                            new DialogInterface.OnClickListener() {
                 // does some work here
                

                推薦答案

                是的 builder.setView(View v); 下面是如何使用它.

                Yep builder.setView(View v); here is how you can use it.

                    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                    View layout = inflater.inflate(R.layout.yourLayoutId, (ViewGroup) findViewById(R.id.yourLayoutRoot));
                    AlertDialog.Builder builder = new AlertDialog.Builder(this)
                    .setView(layout);
                    AlertDialog alertDialog = builder.create();
                    alertDialog.show();
                    SeekBar sb = (SeekBar)layout.findViewById(R.id.yourSeekBar);
                    sb.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
                        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){
                            //Do something here with new value
                        }
                    });
                

                在示例代碼中添加了progressListener.請注意,在調(diào)用 alertDialog.show() 之前,您無法獲得對 SeekBar 的引用,如果 SeekBar 未顯示 findViewById() 將返回 null.另請注意,您必須使用 layout.findViewById(); 因?yàn)?SeekBar 是layout"引用的 RelativeLayout 的子級.

                Added progressListener to sample code. Do note that you cannot get a reference to your SeekBar until after you call alertDialog.show(), if the SeekBar is not being shown findViewById() will return null. Also note that you must use layout.findViewById(); because the SeekBar is a child of the RelativeLayout that 'layout' is a reference to.

                這篇關(guān)于如何在警報(bào)對話框中放置搜索欄?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                Get current location during app launch(在應(yīng)用啟動(dòng)期間獲取當(dāng)前位置)
                locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                  1. <tfoot id='l2x36'></tfoot>
                    <i id='l2x36'><tr id='l2x36'><dt id='l2x36'><q id='l2x36'><span id='l2x36'><b id='l2x36'><form id='l2x36'><ins id='l2x36'></ins><ul id='l2x36'></ul><sub id='l2x36'></sub></form><legend id='l2x36'></legend><bdo id='l2x36'><pre id='l2x36'><center id='l2x36'></center></pre></bdo></b><th id='l2x36'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='l2x36'><tfoot id='l2x36'></tfoot><dl id='l2x36'><fieldset id='l2x36'></fieldset></dl></div>

                      • <bdo id='l2x36'></bdo><ul id='l2x36'></ul>

                        <legend id='l2x36'><style id='l2x36'><dir id='l2x36'><q id='l2x36'></q></dir></style></legend>
                        • <small id='l2x36'></small><noframes id='l2x36'>

                            <tbody id='l2x36'></tbody>

                        • 主站蜘蛛池模板: 日韩av免费在线观看 | 久久久日韩精品一区二区三区 | 中文在线一区二区 | 欧美国产中文字幕 | 欧美日韩亚洲系列 | 欧美一级网站 | 国产传媒视频在线观看 | 亚洲国产精品一区 | 国产欧美精品一区二区 | 91资源在线| 区一区二区三在线观看 | 2018天天干天天操 | 久久精品亚洲精品 | 国产成人精品一区二区三区视频 | 91久久精品一区二区二区 | 久久精品久久久 | 国产一区在线免费 | 日本三级网址 | 成人国产精品色哟哟 | 久久av综合 | 精品国产1区2区3区 在线国产视频 | 精品日韩一区二区三区 | 欧美日韩电影一区 | 中国三级黄色录像 | 亚洲视频在线一区 | 成人精品毛片 | 色五月激情五月 | 日韩精品一区二区在线 | 国产一区二区精品 | 日韩视频在线观看 | 久久综合一区 | 精品国产乱码一区二区三区a | 久久精品国内 | 免费看a| 久久精品网 | 国产一区二区三区四区hd | 日韩高清一区二区 | 国精品一区二区 | 亚洲一区中文字幕 | 91久色 | 青青久在线视频 |