当前位置:首页 » 安卓系统 » android折叠

android折叠

发布时间: 2022-01-10 16:10:21

A. 请教个Android Studio里代码折叠的问题

1. 展开状态

B. android三个按钮叠在一起怎么解决

布局的问题
变成线性布局就行
android:overation="vertical"

C. eclipse android xml文件设置折叠后,没有出现折叠效果。ctrl+/文件左侧空出一列,但是仍然没有折叠节点

这是ecplise的bug,一旦xml的折叠点消失之后,是调不回来的。
强力删除之后再重装试试把。

D. android studio怎么设置折叠

1、可以看到的Android studio的编辑器当中有一段的注释的代码的选项。

2、如果在当前的注释的代码过多的话,进行点击Android studio的菜单中的“code”的选项菜单。

3、然后就会弹出了下拉菜单中进行选择为“folding”的选项菜单。

4、这样就会弹出了下一级的菜单中进行选择为“collapse doc comments”的选项。

5、这样在注释的代码的中被折叠了,那么就看不到所有的注释的信息。

6、注释的代码被折叠了,那么就需要进行展开代码,进行选择为expand doc comments为进行把注释进行展开。

E. android 开发。实现这种叠加显示效果

可以在布局文件使用RelativeLayout,每一层设置长宽,下面的会自动盖在上面那个内容上面

你可以设置每一层的宽高,也可以为每一层添加点击事件,也可以填充你想要的内容,很简单吧?!

<?xmlversion="1.0"encoding="utf-8"?>
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="200dp"
android:layout_height="500dp"
android:layout_centerInParent="true"
android:background="#990099"/>

<LinearLayout
android:layout_width="250dp"
android:layout_height="450dp"
android:layout_centerInParent="true"
android:background="#009999"/>

<LinearLayout
android:layout_width="300dp"
android:layout_height="400dp"
android:layout_centerInParent="true"
android:background="#999900"/>

<LinearLayout
android:layout_width="350dp"
android:layout_height="350dp"
android:layout_centerInParent="true"
android:background="#ff0000"/>
</RelativeLayout>

F. android开发如何实现折叠菜单类似qq分组

用ExpandableListView来实现,可以设置其中的子ListView是展开还是闭合
一、ExpandableListView介绍
一个垂直滚动的显示两个级别(Child,Group)列表项的视图,列表项来自ExpandableListAdapter 。组可以单独展开。
1.重要方法
expandGroup (int groupPos) :在分组列表视图中 展开一组,
setSelectedGroup (int groupPosition) :设置选择指定的组。
setSelectedChild (int groupPosition, int childPosition, boolean shouldExpandGroup) :设置选择指定的子项。
getPackedPositionGroup (long packedPosition) :返回所选择的组
getPackedPositionForChild (int groupPosition, int childPosition) :返回所选择的子项
getPackedPositionType (long packedPosition) :返回所选择项的类型(Child,Group)
isGroupExpanded (int groupPosition) :判断此组是否展开
2.代码:
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);
二、ExpandableListAdapter
一个接口,将基础数据链接到一个ExpandableListView。 此接口的实施将提供访问Child的数据(由组分类),并实例化的Child和Group。
1.重要方法
getChildId (int groupPosition, int childPosition) 获取与在给定组给予孩子相关的数据。
getChildrenCount (int groupPosition) 返回在指定Group的Child数目。
2.代码
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;
}
}
参考自:http://blog.csdn.net/gyflyx/article/details/6461242

G. Android studio 多行注释代码块怎样折叠

/**
*
*
*/
是这样的才可以折叠的

H. Android studio怎么展开/折叠代码注释

可以看到的Android studio的编辑器当中有一段的注释的代码的选项。

如果在当前的注释的代码过多的话,进行点击Android studio的菜单中的“code”的选项菜单。

然后就会弹出了下拉菜单中进行选择为“folding”的选项菜单。

这样就会弹出了下一级的菜单中进行选择为“collapse doc comments”的选项。

这样在注释的代码的中被折叠了,那么就看不到所有的注释的信息。

注释的代码被折叠了,那么就需要进行展开代码,进行选择为expand doc comments为进行把注释进行展开。

I. Android ListView 折叠要怎么弄

个人思路:
Listview 设置适配器的时候,多加2个参数,1、折叠数据(你这里用string[]就好)2、是否折叠

在getview里面判断折叠数据大小,
如果有数据,显示右边的图标按钮;
如果有数据并且不折叠,将string[]内的数据添加到list中;
给图标加一个监听,第二次点击则将是否折叠取反操作,如果折叠状态为true,需要删除list中刚刚添加的string[]数据再刷新

J. android可滑动收起展开布局

以前有个抽屉效果的类,可以实现这个效果。不过这个类后来被摒弃了。可以用SlidingPanelLayout.java试试,不过这个只能左右方向,不能上下方向。

热点内容
单片机android 发布:2024-09-20 09:07:24 浏览:760
如何提高三星a7安卓版本 发布:2024-09-20 08:42:35 浏览:661
如何更换服务器网站 发布:2024-09-20 08:42:34 浏览:308
子弹算法 发布:2024-09-20 08:41:55 浏览:286
手机版网易我的世界服务器推荐 发布:2024-09-20 08:41:52 浏览:814
安卓x7怎么边打游戏边看视频 发布:2024-09-20 08:41:52 浏览:160
sql数据库安全 发布:2024-09-20 08:31:32 浏览:91
苹果连接id服务器出错是怎么回事 发布:2024-09-20 08:01:07 浏览:505
编程键是什么 发布:2024-09-20 07:52:47 浏览:655
学考密码重置要求的证件是什么 发布:2024-09-20 07:19:46 浏览:479