当前位置: 编程技术>移动开发
本页文章导读:
▪PopupWindow罩层兑现 PopupWindow罩层实现
例子:PopupWindowActivity.javapackage com.popup;
import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widge.........
▪ Ehcache施用实例 Ehcache使用实例
Ehcache使用实例(一)
http://blog.csdn.net/mgoann/article/details/4095155#comments
Ehcache使用实例(二)
http://blog.csdn.net/mgoann/article/details/4099190
......
▪ 提早过来跟坛子里的兄弟们说声节日快乐啊 提前过来跟坛子里的兄弟们说声节日快乐啊、
哎、夜深了、突然想过来看看、洗洗睡了、
......
[1]PopupWindow罩层兑现
来源: 互联网 发布时间: 2014-02-18
PopupWindow罩层实现
例子:
PopupWindowActivity.java
main.xml
control.xml
例子:
PopupWindowActivity.java
package com.popup;
import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout.LayoutParams;
import android.widget.PopupWindow;
public class PopupwindowActivity extends Activity {
public PopupWindow mPopupWindow;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
View popupWindow_view = getLayoutInflater().inflate(R.layout.control, null,false);
mPopupWindow = new PopupWindow(popupWindow_view, LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT,true);
Button show = (Button) findViewById(R.id.button1);
show.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
mPopupWindow.showAtLocation(findViewById(R.id.linear),Gravity.RIGHT | Gravity.BOTTOM, 0, 0);
}
});
mPopupWindow.update();
//获取自定义布局文件popup.xml的视图
Button btn1 = (Button)popupWindow_view.findViewById(R.id.button2);
btn1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mPopupWindow.dismiss();
}
});
}
}main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" android:id="@+id/linear">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>control.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#b0000000"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:text="Button" />
</LinearLayout>
[2] Ehcache施用实例
来源: 互联网 发布时间: 2014-02-18
Ehcache使用实例
Ehcache使用实例(一)
http://blog.csdn.net/mgoann/article/details/4095155#comments
Ehcache使用实例(二)
http://blog.csdn.net/mgoann/article/details/4099190
[3] 提早过来跟坛子里的兄弟们说声节日快乐啊
来源: 互联网 发布时间: 2014-02-18
提前过来跟坛子里的兄弟们说声节日快乐啊、
哎、夜深了、突然想过来看看、
洗洗睡了、
哎、夜深了、突然想过来看看、
洗洗睡了、
最新技术文章: