最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android 仿蘋果底部彈出Dialog

 更新時(shí)間:2016年12月26日 11:21:24   作者:jiang547860818  
這篇文章主要介紹了Android 仿蘋果底部彈出Dialog的相關(guān)資料,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

style文件

 <style name="ActionSheetDialogStyle" parent="@android:style/Theme.Dialog">
    <!-- 背景透明 -->
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowContentOverlay">@null</item>
    <!-- 浮于Activity之上 -->
    <item name="android:windowIsFloating">true</item>
    <!-- 邊框 -->
    <item name="android:windowFrame">@null</item>
    <!-- Dialog以外的區(qū)域模糊效果 -->
    <item name="android:backgroundDimEnabled">true</item>
    <!-- 無(wú)標(biāo)題 -->
    <item name="android:windowNoTitle">true</item>
    <!-- 半透明 -->
    <item name="android:windowIsTranslucent">true</item>
    <!-- Dialog進(jìn)入及退出動(dòng)畫 -->
    <item name="android:windowAnimationStyle">@style/ActionSheetDialogAnimation</item>
  </style>
  <!-- ActionSheet進(jìn)出動(dòng)畫 -->
  <style name="ActionSheetDialogAnimation" parent="@android:style/Animation.Dialog">
    <item name="android:windowEnterAnimation">@anim/actionsheet_dialog_in</item>
    <item name="android:windowExitAnimation">@anim/actionsheet_dialog_out</item>
  </style>

動(dòng)畫文件夾anim兩個(gè)文件

actionsheet_dialog_in.xml

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
  android:duration="200"
  android:fromYDelta="100%"
  android:toYDelta="0" />

actionsheet_dialog_out.xml

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
  android:duration="200"
  android:fromYDelta="0"
  android:toYDelta="100%" />

主Activity應(yīng)用

private View inflate;
  private Dialog dialog;
  public void show(){
    dialog = new Dialog(oThis,R.style.ActionSheetDialogStyle);
    inflate = LayoutInflater.from(oThis).inflate(R.layout.fast_trade_view, null);
    dialog.setContentView(inflate);
    Window dialogWindow = dialog.getWindow();
    dialogWindow.setGravity( Gravity.BOTTOM);
    WindowManager.LayoutParams lp = dialogWindow.getAttributes();
    lp.y = 20;
    dialogWindow.setAttributes(lp);
    dialog.show();
  }

以上所述是小編給大家介紹的Android 仿蘋果底部彈出Dialog,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

新乐市| 开原市| 阳高县| 双桥区| 喜德县| 永善县| 拉萨市| 永福县| 无棣县| 牡丹江市| 和顺县| 娱乐| 黄龙县| 中江县| 三明市| 长垣县| 电白县| 烟台市| 盐山县| 北流市| 克东县| 林芝县| 铜山县| 寻甸| 贺州市| 塔河县| 安多县| 阿荣旗| 余庆县| 龙游县| 亚东县| 尤溪县| 隆安县| 威宁| 安义县| 读书| 湘潭市| 潼关县| 涞源县| 古田县| 常德市|