设置popupWindow布局里面的控件
来源:互联网 发布:sql developer怎么卸载 编辑:程序博客网 时间:2024/06/05 23:47
package com.cherish.popupwindow;import android.app.ActionBar;import android.app.Activity;import android.content.Context;import android.graphics.Bitmap;import android.graphics.drawable.BitmapDrawable;import android.os.Bundle;import android.text.Layout;import android.view.LayoutInflater;import android.view.View;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.ListView;import android.widget.PopupWindow;import android.widget.TextView;public class MainActivity extends Activity { private Context context; private String[] strings ={"移动1","移动2","移动3","移动4"}; private Button button; private ListView listView; private PopupWindow popupWindow; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); context=this; button = (Button) findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { View layout = getLayoutInflater().inflate(R.layout.popupwindow_layout, null); popupWindow= new PopupWindow(layout, ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT,true); popupWindow.setTouchable(true); popupWindow.setOutsideTouchable(true); popupWindow.setBackgroundDrawable(new BitmapDrawable(getResources(),(Bitmap) null)); popupWindow.showAsDropDown(v); listView= (ListView) layout.findViewById(R.id.list_view); ArrayAdapter<String> adapter = new ArrayAdapter<String>(v.getContext(), android.R.layout.simple_list_item_1, strings); listView.setAdapter(adapter); } }); }}
0 0
- 设置popupWindow布局里面的控件
- popupWindow的布局隐藏触发设置
- cell里面控件宽度布局的问题
- 遍历一个布局里面所有的控件
- 父布局用子布局里面的控件
- Combo控件的布局设置
- 自定义布局的PopupWindow
- 线性布局控件间的布局设置
- updatepanel 里面设置控件的焦点
- 控件PopupWindow的使用
- Delphi 2006里面的界面布局(layout)控件
- android:textAppearance xml布局里面设置文字的外观:
- 设置ScrollView 里面的布局高度为match_parent不起作用
- Android 动态设置控件的布局
- 代码设置控件的相对布局属性
- radio控件设置纵向布局的方法
- 关于自定义PopupWindow里面视图的控制
- dockwidget 设置里面的控件填满整个dockwidget的方法
- 识别和分析事物问题的思维方法
- viewpager导致的fragment嵌套不触发onActivityResult方法不触发解决方式
- eclipse 使用maven 构建web项目
- PAT-B 1021. 个位数统计 (15)
- mysql运维之服务器日志
- 设置popupWindow布局里面的控件
- bus_type
- python自动化之路-javascript补充
- spring +ehcache 缓存实例
- cs app lab1 深入理解计算机系统
- ES6 简单入门分享
- 给 Android 开发者的 RxJava 详解
- arcgis api for js入门开发系列十二 GP服务 实现缓冲区及运算分析(含源代码)
- ehcache 简介和基本api使用