當前位置:首頁 » 安卓系統 » 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 瀏覽:660
如何更換伺服器網站 發布:2024-09-20 08:42:34 瀏覽:308
子彈演算法 發布:2024-09-20 08:41:55 瀏覽:285
手機版網易我的世界伺服器推薦 發布:2024-09-20 08:41:52 瀏覽:813
安卓x7怎麼邊打游戲邊看視頻 發布:2024-09-20 08:41:52 瀏覽:159
sql資料庫安全 發布:2024-09-20 08:31:32 瀏覽:90
蘋果連接id伺服器出錯是怎麼回事 發布:2024-09-20 08:01:07 瀏覽:504
編程鍵是什麼 發布:2024-09-20 07:52:47 瀏覽:655
學考密碼重置要求的證件是什麼 發布:2024-09-20 07:19:46 瀏覽:479