게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
안드로이드 하단 레이아웃 고정 방법좀.. 질문드려요...;;;
게시물ID : programmer_8848짧은주소 복사하기
작성자 : 율율융
추천 : 0
조회수 : 9294회
댓글수 : 6개
등록시간 : 2015/03/23 19:39:47
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/linearlay1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    tools:context="com.example.timetable.SecondTab" >
    
        
  <ListView
        android:id="@+id/dataListView1"
        android:layout_weight="0.75"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:padding="10dp">
    </ListView>
        
      <LinearLayout
    android:id="@+id/splitactionbar2"
    android:layout_width="match_parent"
    android:layout_height="0px"
    android:layout_weight="0.25"
    android:layout_marginBottom="0dp"
    android:background="#000000"
    android:gravity="bottom"
    android:orientation="horizontal" >
            
 <Button
     android:id="@+id/setting2"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_weight="1"
     android:textColor="#ffffff"
     android:text="setting" />

 <Button
     android:id="@+id/refresh2"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_weight="1"
     android:text="refresh"
     android:textColor="#ffffff" />
            
    </LinearLayout>


</LinearLayout>

이건 코드고요,...
제가 화면의 하단에 메뉴바 처럼 고정시키고 싶은대..;;
리스트 뷰의 크기에 따라서 splitactionbar2 이 레이아웃의 위치가 달라지더라구요..;
별 짓을 다해봤는대..;; 안되더라구요..;;

해본 짓.
1. 전체를 framlayuot으로 감싸고 하단의 레이아웃에 gravity를 bottom으로 준다.- fail...;;
2. layout_weight을 사용하여 listview 0.7 // splitactionbar2 0.3으로 비율을 나눠준다. -fail..;;
3. 각종 레이아웃들의 속성을 변경해본다.;; fail....

원래는.....아래의 속성을 사용해서 해결하려 했으나..
알아보니 저거는 가로의 해상도가 400dip 이하의 스마트폰에서만 
된다더군요...;; ㅠㅠ
(잘은 알아보지는 못했지만.. deprecated됬다는 것 같기도하고..;;)

혹시 레이아웃을 하단에 고정시키는 방법을 아시거나(리스트뷰의 크기와 상관없이..;;) 
split actionbar 같은 효과를 낼 수 있는 방법을 아신다면... 도와주세요,.ㅜㅜ
<manifest ...>
   
<activity uiOptions="splitActionBarWhenNarrow" ... >
       
<meta-data android:name="android.support.UI_OPTIONS"
                   
android:value="splitActionBarWhenNarrow" />
   
</activity>
</manifest>
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호