我正在使用expandablelistview来显示包含不同子项数的组列表.有时列表很长,所以我想启用fastscroll.我做了这个,当我用通常的方式用手指滚动列表时一切正常.
但当我抓住拇指并将其拖到底部时,当我将拇指从顶部移动大约1/3的高度时,列表会滚动到最后位置.如何让拇指根据滚动条的整个高度定位列表?
我的Android应用程序上的Expandable ListView存在问题
这是我的代码
package proyek.akhir;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseExpandableListAdapter;
import android.widget.ExpandableListView;
import android.widget.ExpandableListView.OnChildClickListener;
import android.widget.ExpandableListView.OnGroupCollapseListener;
import android.widget.ExpandableListView.OnGroupExpandListener;
import android.widget.Toast;
import android.widget.ExpandableListView.OnGroupClickListener;
import android.widget.TextView;
public class list_tempat extends Activity {
private List<String> groupData;
private List<List<String>> childrenData;
static String asalfromList ;
protected static final …Run Code Online (Sandbox Code Playgroud) 我正在尝试在expandablelistview中为我的子视图设置动画.我希望子视图在展开组时从顶部向下滑动,并在折叠组时从底部滑动到顶部.我已经看过几种方法(动画视图组或子视图),但似乎没有一种方法可以很好地工作,或者我做得不对.
我已经从BaseExpandableListAdapter扩展了一个类来创建我自己的自定义适配器.我还有我在getChildView和getGroupView方法中膨胀的组/子项的自定义(xml)视图.
我只希望当前崩溃/扩展的小组为其孩子制作动画.谁能指出我正确的方向?如果您需要更多信息或代码,请告诉我们!
问候,伊沃
我正在使用可扩展的列表视图.我在onceate方法中给出了setOnChildClickListener,但setOnChildClickListener不工作,我在SO中搜索解决方案,但我找不到任何解决方案.在这里给我做了什么
public class MenuActivity extends Activity{
ArrayList<MyObject> CatList = new ArrayList<MyObject>();
ArrayList<Object> childItem = new ArrayList<Object>();
ExpandableListView ExList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.menuactivity);
ExList=(ExpandableListView) findViewById(R.id.lvMenu) ;
ExList.setOnChildClickListener(new OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
ShowItem(CatList.get(childPosition).getId());
Toast.makeText(context, ""+CatList.get(childPosition).getId(), 1).show();
// TODO Auto-generated method stub
return false;
}
});
}
public void ShowItem(int id)
{
// do something
}
public class ElistAdapt extends BaseExpandableListAdapter {
public ArrayList<MyObject> groupItem, tempGrpChild;
public …Run Code Online (Sandbox Code Playgroud) 我有一个ExpandableListView内部NestedScrollView(是的我知道,在另一个滚动视图中有一个滚动视图是不好的,但我不知道还有什么要做,请告诉我,如果有人知道更好的方法).
内容的大小NestedScrollView仍然在屏幕内,因此它不会滚动,但是当ExpandableListView展开时,内容将泄漏到屏幕外但NestedScrollView仍然不会滚动..为什么会这样?
这是我的NestedScrollView布局:
<NestedScrollView>
<LinearLayout>
<LinearLayout></LinearLayout>
... // About 3 of the LinearLayouts
<ExpandableListView/>
</LinearLayout>
</NestedScrollView>
Run Code Online (Sandbox Code Playgroud) 我正在开发ExpandableListView我已经完成了工作,现在只有一件事我想做的是我不希望ListView在点击可扩展列表视图时被DropDown而我想要显示它已打开所有项目显示在里面而不对它们进行任何点击.
谁能告诉我怎么能这样做呢.
我有小图标的组指示,我使用groupIndicator调用选择器来绘制它,但我看到android默认拉伸该图标以适合文本大小
我该如何防止这种行为,并显示原始大小的图标?
我正在使用
<ExpandableListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ExpandableListView>
Run Code Online (Sandbox Code Playgroud)
我想在onclick父级时为孩子添加动画幻灯片.那我该怎么办?
我想让我的ExpandableListActivity与Honeycomb兼容.我想知道为什么兼容包没有ExpandableListFragment.
有没有办法使ExpandableListView与普通的Fragment类一起工作?如何使用LoaderManager加载游标?
android expandablelistview android-fragments android-loadermanager android-support-library
好吧,我正在尝试创建一个像Spotify一样的ExpandableListView它...但我不知道如何禁用LinearLayout像一个按钮(展开列表)我已经创建了一个图像应该描述我喜欢什么.我喜欢有可能处理文本/图像(父)的点击作为正常的交互.单击右键应该像Spotify一样展开列表...
