編輯:關於Android編程
Android ScrollView嵌套ExpandableListView顯示不正常的問題的解決辦法
前言:
關於ScrollView嵌套ExpandableListView導致ExpandableListView顯示不正常的問題解決方法有很多,在這裡介紹一種小編親自測試通過的方法。
重寫ExpandableListView:
實例代碼:
package com.jph.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ExpandableListView;
/**
* 重寫ExpandableListView以解決ScrollView嵌套ExpandableListView
*<br> 導致ExpandableListView顯示不正常的問題
* @author jph
* Date:2014.10.21
*/
public class CustomExpandableListView extends ExpandableListView {
public CustomExpandableListView(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public CustomExpandableListView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public CustomExpandableListView(Context context, AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// TODO Auto-generated method stub
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
在XML中將ExpandableListView替換為重寫的ExpandableListView即可。
<com.jph.view.CustomExpandableListView android:id="@+id/elItems"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
android之屬性動畫
屬性動畫---res/animator屬性動畫故名思議就是通過動畫的方式改變對象的屬性了,我們首先需要了解幾個屬性:Duration動畫的持續時間,默認300ms。Tim
編譯android源碼6---運行android編譯源碼
1.配置環境變量 (/media/M_hM_=M_M_dM__M_6/Download/442為android所在的目錄)export PATH=$PATH:/media
Android自定義ViewGroup打造各種風格的SlidingMenu
上篇給大家介紹QQ5.0側滑菜單的視頻課程,對於側滑的時的動畫效果的實現有了新的認識,似乎打通了任督二脈,目前可以實現任意效果的側滑菜單了,感謝鴻洋大大!!用的是Hori
基於XMPP 協議的開發 android
設計過一款基於開源的XMPP即時通信協議的軟件,采用C/S協議,通過GPRS無線網絡用TCP協議到服務器,以架設開源的Openfire 服務器作為即時通訊平台 系統主要由