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

Android 實(shí)現(xiàn)抖音頭像底部彈框效果的實(shí)例代碼

 更新時(shí)間:2020年04月21日 15:51:51   作者:迷路國(guó)王  
這篇文章主要介紹了Android 實(shí)現(xiàn)抖音頭像底部彈框效果,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

布局文件

activity_test.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  xmlns:app="http://schemas.android.com/apk/res-auto">



  <LinearLayout
    android:id="@+id/linearLayout"
    android:orientation="vertical"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintBottom_toBottomOf="parent"
    android:background="@color/colorAccent"
    android:layout_width="match_parent"
    android:layout_height="300dp">
  </LinearLayout>
  <View
    android:layout_width="match_parent"
    android:layout_height="100dp"
    app:layout_constraintTop_toTopOf="@+id/linearLayout"
    app:layout_constraintBottom_toTopOf="@+id/linearLayout"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    android:alpha="0"
    android:background="@android:color/white"
    />
  <ImageView
    android:id="@+id/image"
    android:src="@mipmap/ic_launcher"
    app:layout_constraintTop_toTopOf="@+id/linearLayout"
    app:layout_constraintBottom_toTopOf="@+id/linearLayout"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    android:layout_marginTop="100dp"
    android:layout_width="100dp"
    android:layout_height="100dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java

點(diǎn)擊事件

View contentView = LayoutInflater.from(MainActivity.this).inflate(R.layout.activity_test, null);
        PopupWindow popWnd = new PopupWindow(MainActivity.this);
        popWnd.setContentView(contentView);
        popWnd.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
        popWnd.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
        popWnd.setBackgroundDrawable(new ColorDrawable(0x00000000));
        popWnd.setOutsideTouchable(false);
        popWnd.setFocusable(true);
        //相對(duì)于父控件的底部顯示 無(wú)任何偏移
        popWnd.showAtLocation(v, Gravity.BOTTOM, 0, 0);

在這里插入圖片描述

到此這篇關(guān)于Android 實(shí)現(xiàn)抖音頭像底部彈框效果的文章就介紹到這了,更多相關(guān)android 抖音彈框內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論

龙川县| 昌乐县| 富平县| 正安县| 威远县| 芷江| 米泉市| 洛阳市| 太白县| 博兴县| 三台县| 滕州市| 元谋县| 宁城县| 徐州市| 凤阳县| 德阳市| 阿坝县| 文山县| 南投市| 新巴尔虎右旗| 孝义市| 呼伦贝尔市| 准格尔旗| 宿州市| 宽城| 简阳市| 论坛| 吉隆县| 平乐县| 龙江县| 巍山| 丘北县| 磐安县| 乌拉特中旗| 怀安县| 民和| 大竹县| 平潭县| 乌苏市| 海伦市|