自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(2)
  • 资源 (1)
  • 收藏
  • 关注

原创 android中PopupWindow的使用教程

1.定义变量private View popView = null;private PopupWindow popupWindow = null;2.源码使用 if (popView == null) {                popView = LayoutInflater.from(this).inflate(R.layout.popupwindow_layout,

2017-06-27 12:10:57 195

转载 ionic-移动端web的性能优化开源组件

在移动端开发webapp或者hybrid的app应用,由于网络,终端体验问题,对于移动端需要做好很多的优化,下面是本人在工作和学习发现的比较好的一些优化方案,现在整理一下,希望可以学习。1、四种方式优化ionic,接近原生体验http://scottbolinger.com/4-ways-to-make-your-ionic-app-feel-native/2、ionic的问题

2017-02-09 11:20:05 348

android 的类似于QQ分组的二级列表

package wjq.WidgetDemo; import android.app.ExpandableListActivity; import android.os.Bundle; import android.provider.Contacts.People; import android.util.Log; import android.view.ContextMenu; import android.view.Gravity; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.ContextMenu.ContextMenuInfo; import android.widget.AbsListView; import android.widget.BaseExpandableListAdapter; import android.widget.ExpandableListAdapter; import android.widget.ExpandableListView; import android.widget.TextView; import android.widget.Toast; import android.widget.ExpandableListView.ExpandableListContextMenuInfo; public class ExpandableListDemo extends ExpandableListActivity{ private ExpandableListAdapter adapter; //private MyExpandableListAdapter MyAdapter=new MyExpandableListAdapter(); /* (non-Javadoc) * @see android.app.Activity#onCreate(android.os.Bundle) */ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); adapter=new MyExpandableListAdapter(); setListAdapter(adapter); registerForContextMenu(getExpandableListView()); } /* (non-Javadoc) * @see android.app.ExpandableListActivity#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo) */ @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { menu.setHeaderTitle("菜单"); menu.add(0, 0, 0, "Action"); } /* (non-Javadoc) * @see android.app.Activity#onContextItemSelected(android.view.MenuItem) */ @Override public boolean onContextItemSelected(MenuItem item) { boolean flag=false; // TODO Auto-generated method stub ExpandableListContextMenuInfo menuInfo=(ExpandableListContextMenuInfo)item.getMenuInfo(); String title=((TextView)menuInfo.targetView).getText().toString(); int type=ExpandableListView.getPackedPositionType(menuInfo.packedPosition); if (type==ExpandableListView.PACKED_POSITION_TYPE_CHILD) { int groupPos =ExpandableListView.getPackedPositionGroup(menuInfo.packedPosition); int childPos =ExpandableListView.getPackedPositionChild(menuInfo.packedPosition); CharSequence str="您单击了"+title; Toast.makeText(this, str, Toast.LENGTH_SHORT).show(); Log.i("tag", "Run Hereing..."); flag= true; } else if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) { int groupPos = ExpandableListView.getPackedPositionGroup(menuInfo.packedPosition); CharSequence cs="您单击了"+title; Toast.makeText(this, cs, Toast.LENGTH_SHORT).show(); Log.i("tag", "Run Here..."); flag= true; } return flag; } public class MyExpandableListAdapter extends BaseExpandableListAdapter { // Sample data set. children[i] contains the children (String[]) for groups[i]. public String[] groups = { "我的好友", "新疆同学", "亲戚", "同事" }; public String[][] children = { { "胡算林", "张俊峰", "王志军", "二人" }, { "李秀婷", "蔡乔", "别高", "余音" }, { "摊派新", "张爱明" }, { "马超", "司道光" } }; public Object getChild(int groupPosition, int childPosition) { return children[groupPosition][childPosition]; } public long getChildId(int groupPosition, int childPosition) { return childPosition; } public int getChildrenCount(int groupPosition) { return children[groupPosition].length; } public TextView getGenericView() { // Layout parameters for the ExpandableListView AbsListView.LayoutParams lp = new AbsListView.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, 64); TextView textView = new TextView(ExpandableListDemo.this); textView.setLayoutParams(lp); // Center the text vertically textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); // Set the text starting position textView.setPadding(36, 0, 0, 0); return textView; } public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { TextView textView = getGenericView(); textView.setText(getChild(groupPosition, childPosition).toString()); return textView; } public Object getGroup(int groupPosition) { return groups[groupPosition]; } public int getGroupCount() { return groups.length; } public long getGroupId(int groupPosition) { return groupPosition; } public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { TextView textView = getGenericView(); textView.setText(getGroup(groupPosition).toString()); return textView; } public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } public boolean hasStableIds() { return true; } } }

2014-08-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除