안녕하세요 안드로이드 초보 개발자입니다..
일단소스부터 보시죠..
<com.newtalktalk.classes.listviewcustom
android:id="@+id/main_box_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e9edee"
android:visibility="visible"
android:fillViewport="true">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:orientation="horizontal"
>
<RelativeLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
>
<ImageButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/common_default_profile_img"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shadow_white_thumbnail"
/>
</RelativeLayout>
</LinearLayout>
<ListView
android:id="@+id/Lv_wholesale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:choiceMode="none"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:longClickable="false"
android:scrollbars="none"
/>
</LinearLayout>
</com.newtalktalk.classes.listviewcustom>
액티비티
private ListView Lv_wholesale;
private View header;
private ScrollView sc;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test);
Lv_wholesale= (ListView)findViewById(R.id.Lv_wholesale);
sc = (listviewcustom)findViewById(R.id.main_box_scrollview);
header = getLayoutInflater().inflate(R.layout.header, null, false);
// Lv_wholesale.addHeaderView(header);
String data[] ={"aaaa","Aafwfe","상푸우우우우움","상푸우우우우움","상푸우우우우움","상푸우우우우움",
"aaaa","Aafwfe","상푸우우우우움","상푸우우우우움","상푸우우우우움","상푸우우우우움",
"aaaa","Aafwfe","상푸우우우우움","상푸우우우우움","상푸우우우우움","상푸우우우우움",
"aaaa","Aafwfe","상푸우우우우움","상푸우우우우움","상푸우우우우움","상푸우우우우움"};
Lv_wholesale.setAdapter(new PopupListView(this, data));
sc.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
Log.d("--", "in");
Lv_wholesale.requestDisallowInterceptTouchEvent(true);
return true;
}
});
listviewcustom
public listviewcustom(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
public listviewcustom(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public listviewcustom(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
// TODO Auto-generated method stub
return super.onInterceptTouchEvent(ev);
}
테스트를 하는거라 파일이름은 신경쓰지않았습니다.
현제 xml은 커스텀스크롤뷰 안에 listview가 있습니다..
제가 구현하려구 하는것은 listview header를 사용한것처럼 스크롤이 전체 화면이 되어야 하는데요..
여기저기 구글링해서 알아보고 한 결과물이 저것입니다 ㅠㅠ
아무리해도.. listview의 스크롤은 막고 scrollview의 스크롤만 사용하려구 해도 안되네요 ㅠㅠ
고수님들 도와주세요 ㅠㅠ