2011-03-11 6 views
1

Android 2.x의 기본 캘린더 앱의 '일정 만들기'화면과 매우 유사한 양식을 만들려고합니다. 기본적으로 수정 된 일정이 있습니다. 머리글, 고정 바닥 글 및 가운데는 "이벤트", "보낸 사람", "받는 사람", "위치"등과 같은 다른 "질문"이 포함 된 ScrollView입니다 (내 생각 엔).Android : 캘린더 앱과 유사한 레이아웃을 만드는 방법 - 이벤트 만들기

옵션을 선택했지만 화면의 높이 계산과 관련이없는 올바른 레이아웃을 찾을 수 없습니다.

도움이 될 것입니다!

+0

높이를 계산하면 어떨까요? 스크롤 할 수 있으면 높이를 계산할 필요가 없습니다. –

+0

동의하지만, 고정 된 꼬리말을 놓는 데 어려움이 있습니다 – Johann

답변

1

은 내가 RelativeLayout의를 사용

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 
<TextView 
    android:id="@+id/status_header" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" 
    android:paddingTop="8px" 
    android:paddingBottom="8px" 
    android:gravity="center" 
    android:textColor="@color/header_foreground" 
    android:background="@color/header_background" 
    android:text="@string/status_header"/> 
<ScrollView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/statuspanel" 
    android:layout_above="@+id/status_footer"> 

어쩌면 TableLayout을에, 여기에 모든 중간 비트를 넣어

</ScrollView> 
<TableLayout 
    android:id="@+id/status_footer" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:paddingTop="4px" 
    android:paddingLeft="2px" 
    android:paddingRight="2px" 
    android:stretchColumns="*" 
    android:textColor="@color/footer_foreground" 
    android:background="@color/footer_background"> 
    <TableRow> 
     <Button 
      android:id="@+id/status_backbutton" 
      android:layout_width="0px" 
      android:layout_weight="1" 
      android:text="@string/status_backbutton" /> 
    </TableRow> 
</TableLayout> 
</RelativeLayout> 

당신은 내 모든 색상 비트를 용서해야합니다,하지만 당신은 아이디어를 얻을 . 키가있는 RelativeLayout에 alignParent 요소를 사용하고 있다고 생각합니다.

+0

'px' 대신'dp'를 사용하면 안되나요? – binnyb

+0

아마도. 나는이 모든 것들이 어떻게 정직하게 작동하는지에 관해 정말로 생각하지 않고있다. 나는 320x480 이상의 최소 내 애플 리케이션을 설계하고 운영 체제는 모든 크기 조정을 밖으로 내버려 두지 – FrinkTheBrave

+0

도와 줘서 고마워, 내가 필요로하는 정확히 방식으로 일하고있어. ''dp'가'px'보다 더 표준적인 것으로 보았습니다. – Johann

관련 문제