도와주세요. ListView에 항목을 추가 할 수 있습니다 (LItem : = ListView.Items.Add), 그러나 어떻게 머리글과 바닥 글을 추가 할 수 있습니까? 델파이 XE5!에서. 자바가 아닙니다.ListView에 머리말과 꼬리말을 추가하는 방법 (Android XE5)
3
A
답변
1
전이 문제도 만났습니다. 내 구성 요소에서 내 목록보기 기능을 새로 고치기 위해 풀 다운을 추가하려고합니다. 내가 한 일은, 다음 내 ListView를 서브 클래스에서, 나는 다음 코드를 사용하십시오 XML 레이아웃 파일에서 뷰 레이아웃을 선언하는 것입니다 :
private void init(Context context) {
inflater = LayoutInflater.from(context);
headerRelativeLayout = (RelativeLayout)inflate(context, R.layout.refresh_header_view, null);
arrowImage = (ImageView)headerRelativeLayout.findViewById(R.id.head_arrowImageView);
progressBar = (ProgressBar)headerRelativeLayout.findViewById(R.id.head_progressBar);
headerTextView = (TextView)headerRelativeLayout.findViewById(R.id.head_tipsTextView);
lastUpdateDateTextView = (TextView)headerRelativeLayout.findViewById(R.id.head_lastUpdatedDateTextView);
headerRelativeLayout.setPadding(0, -1 * HEADER_HEIGHT, 0, 0);
this.addHeaderView(headerRelativeLayout, null, false);
}
를 들면 다음과 같습니다
this.addHeaderView(headerRelativeLayout, null, false); //this is the ListView sub class
내 모든 코드는 자세한 내용은 다음을 확인하십시오. Drag to Refresh in ListView Android Example
3
LItem : = ListView.Items.Add; LItem.Purpose : = TListItemPurpose.Footer;
0
이
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom|top"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/background_bottom_bar"
>
<TextView
android:text="Header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<GridView
android:id="@+id/gridview_practioner"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:columnWidth="90dp"
android:horizontalSpacing="10dp"
android:numColumns="5"
android:layout_weight="1"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:text="Footer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/background_bottom_bar"
android:layout_gravity="bottom"/>
</LinearLayout>
</LinearLayout>
참고하십시오 : 당신이 목록보기 나있는 gridview를 사용하는 경우 여기
을, 당신은 목록보기 또는 gridview에 무게 = 1을 제공합니다.
결코 그런 대답은 문제에 대한 접근 방식을 설명해야합니다. 이 사이트에 답변하기 전에 FAQ를 읽으십시오. – Hamad