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

    <bdo id='cAMOe'></bdo><ul id='cAMOe'></ul>
    1. <small id='cAMOe'></small><noframes id='cAMOe'>

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

        <tfoot id='cAMOe'></tfoot>

        <legend id='cAMOe'><style id='cAMOe'><dir id='cAMOe'><q id='cAMOe'></q></dir></style></legend>
      1. 在 Android 中創建自定義對話框

        Creating a custom dialog in Android(在 Android 中創建自定義對話框)
        <legend id='IppuX'><style id='IppuX'><dir id='IppuX'><q id='IppuX'></q></dir></style></legend>
        • <small id='IppuX'></small><noframes id='IppuX'>

            <bdo id='IppuX'></bdo><ul id='IppuX'></ul>

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

                  <tbody id='IppuX'></tbody>

                1. 本文介紹了在 Android 中創建自定義對話框的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試在 Android 中創建自定義對話框.但是無論我嘗試做什么,我都無法更改對話框的寬度.它只是保持不變.以下是我設置為對話框內容的視圖.

                  I am trying to create a custom dialog in Android. But whatever I tried to do, I am not able to change the width of the dialog. It just remains the same. The following is the view that I am setting as the content for the dialog.

                  <RelativeLayout  
                  android:id="@+id/current_stats"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" 
                  android:visibility="visible">
                  <ImageView android:id="@+id/player_image" 
                      android:src="@drawable/person"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_centerHorizontal="true"/>
                  <TextView   
                      android:id="@+id/player_name"
                      android:layout_below="@id/player_image"
                      android:layout_centerHorizontal="true"
                      android:text="Raja Ram"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"/>
                  <ImageButton android:id="@+id/dialog_close"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_alignParentTop="true"
                      android:layout_alignParentRight="true"
                      android:background="#00000000"
                      android:src="@drawable/close_button_selector"/>
                  <ImageButton android:id="@+id/dialog_flip"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_alignParentTop="true"
                      android:layout_alignParentLeft="true"
                      android:background="#00000000"
                      android:src="@drawable/rotate"/>
                  </RelativeLayout>
                  

                  如您所見,我在此代碼示例中使用 wrap_content 的所有地方.我也嘗試了以下選項

                  As you can see, everywhere I am using wrap_content in this code sample. Also I tried the following options

                  1) 像這樣創建對話框時設置自定義樣式.

                  1) Setting a custom style while creating the Dialog like this.

                  dialog = new Dialog(this,R.style.Theme_Dialog);
                  

                  并且樣式如下

                  <resources>
                  <style name="Theme" parent="android:Theme">
                  </style>
                  <style name="Theme.Dialog">
                      <item name="android:layout_width">wrap_content</item>
                      <item name="android:layout_height">wrap_content</item>
                      <item name="android:windowIsFloating">true</item>
                      <item name="android:windowContentOverlay">@null</item>
                      <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
                      <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
                  </style>
                  </resources>
                  

                  2) 像這樣在 onCreateDialog() 中設置視圖的參數

                  2) Setting the parameters for the view in the onCreateDialog() like this

                  LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                  v = inflater.inflate(R.layout.player_info, null, false);
                  ViewGroup.LayoutParams p = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
                  dialog.setContentView(v,p);
                  

                  3) 我也嘗試在 onCreateDialog() 方法中設置這樣的 Window 參數

                  3) I also tried to set the Window parameters like this in the onCreateDialog() method

                  WindowManager.LayoutParams params = dialog.getWindow().getAttributes();
                  params.width=WindowManager.LayoutParams.WRAP_CONTENT;
                  dialog.getWindow().setAttributes(params);
                  

                  但還是沒有運氣.有人可以幫我解決這個問題.難道我做錯了什么??您能否建議我如何設置對話框窗口的 x 和 y 位置?

                  But again no luck. Can someone help me out with this issue. Am I doing something wrong?? Also can you please suggest me how to set the x and y postions for the Dialog window?

                  謝謝

                  推薦答案

                  找了好久才發現問題.問題在于我使用相對布局的方式.我想我沒有正確指定相對位置.當我將其更改為線性布局時,它工作正常.它并沒有用完整個屏幕,而是只用了需要的東西.

                  I figured out the problem after a long time. The problem was with the way I used Relative layout. I guess I have not specified the relative position properly. When I changed that to linear layout it worked fine. It was not using up the whole screen but only whatever is required.

                  這篇關于在 Android 中創建自定義對話框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  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 或網絡提供商)
                  Get current location during app launch(在應用啟動期間獲取當前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                2. <small id='4VMTJ'></small><noframes id='4VMTJ'>

                  <tfoot id='4VMTJ'></tfoot>
                  <legend id='4VMTJ'><style id='4VMTJ'><dir id='4VMTJ'><q id='4VMTJ'></q></dir></style></legend>
                        <bdo id='4VMTJ'></bdo><ul id='4VMTJ'></ul>

                        <i id='4VMTJ'><tr id='4VMTJ'><dt id='4VMTJ'><q id='4VMTJ'><span id='4VMTJ'><b id='4VMTJ'><form id='4VMTJ'><ins id='4VMTJ'></ins><ul id='4VMTJ'></ul><sub id='4VMTJ'></sub></form><legend id='4VMTJ'></legend><bdo id='4VMTJ'><pre id='4VMTJ'><center id='4VMTJ'></center></pre></bdo></b><th id='4VMTJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4VMTJ'><tfoot id='4VMTJ'></tfoot><dl id='4VMTJ'><fieldset id='4VMTJ'></fieldset></dl></div>
                            <tbody id='4VMTJ'></tbody>
                          1. 主站蜘蛛池模板: 99成人在线视频 | 久久久青草婷婷精品综合日韩 | 亚洲一区二区中文字幕在线观看 | 日韩中文字幕在线不卡 | 91视频88av| 免费一级毛片 | 高清一区二区 | 欧美日韩国产精品一区 | 狠狠综合久久av一区二区老牛 | 色在线免费| 午夜在线视频 | 欧美视频第二页 | 国产精品国产三级国产a | 日韩福利 | 久久成人一区 | 一区二区三区国产好 | 成人av网站在线观看 | 欧美另类视频 | 国产一区二区三区在线 | 久久国产高清视频 | 一级毛片在线视频 | 97国产一区二区精品久久呦 | 欧美一级免费黄色片 | 欧美成人一区二区 | 久久成人精品一区二区三区 | av特级毛片 | 农村妇女毛片精品久久久 | www操操| 在线国产一区 | 午夜成人在线视频 | 成人亚洲性情网站www在线观看 | 国产小视频自拍 | 亚洲中午字幕 | 成人亚洲 | 黄色在线免费观看视频网站 | 亚洲成网| 国产高清在线精品 | 亚洲午夜视频在线观看 | 精品久久久网站 | 亚洲一区二区三区免费观看 | 国产一级淫片免费视频 |