PopupWindow的使用
来源:互联网 发布:color软件下载安装 编辑:程序博客网 时间:2024/06/15 12:08
首先在做PopupWindow要先写一个XML,主要是点击之后弹窗里面的东西就是布局,怎样排列就怎样写
<TextView android:id="@+id/tv01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="你好1"/><TextView android:id="@+id/tv02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="你好2"/><TextView android:id="@+id/tv03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="你好3"/>然后在activity里面先实例化PopupWindow,写一个点击
public class Main2Activity extends AppCompatActivity { private Button bt; private PopupWindow pop; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); bt = (Button) findViewById(R.id.bt);//获取布局视图 View inflate = LayoutInflater.from(Main2Activity.this).inflate(R.layout.item, null); pop = new PopupWindow(inflate,200,300); bt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) {//进行显示 pop.showAsDropDown(bt); } }); }}
阅读全文
0 0
- Android PopupWindow的使用
- Android PopupWindow的使用
- Android PopupWindow的使用!!!
- 关于popupWindow的使用
- PopupWindow的使用
- PopupWindow的使用例子
- PopupWindow的使用
- popupWindow的使用心得
- PopupWindow的使用
- PopupWindow的使用
- Android PopupWindow的使用!!!
- PopupWindow的使用
- PopupWindow的使用
- popupWindow的使用
- PopupWindow的使用
- PopupWindow的使用
- Popupwindow的使用
- PopupWindow的使用
- 理解 JavaScript 的 async/await
- 路由,删除,模糊查询,查询天气,全选,添加
- ORA-00838: Specified value of MEMORY_TARGET 解决方案!
- 设计模式简介
- Python与函数重载
- PopupWindow的使用
- js websocket
- Java算法-快速排序
- url中的20%、22%、26%、7B%、%7D、28%、29%怎么解析还原成真实的字符
- QT开发错误集
- 函数对象---operator()
- CDH 里面配置spark-sql
- 域名解密 商家联盟会员消费管理系统_连锁店会员积分系统 带微信(域名加密的) aqinxiaodian
- Python入门猜拳小游戏