2017-03-27 1 views
0

현재 나는 안드로이드 UI에서 일하고 있습니다. Tablayout 위에 중첩 될 수있는 더 큰 탭 항목을 만들기 위해 사용할 수있는 방법이나 속성입니다. 이 카메라 버튼처럼큰 항목 overlaying 안드로이드에서 TabLayout

: 사전에

enter image description here

감사합니다.

+0

에 해당 크기를 변경할 수 있습니다. 당신은이 설명을 더 명확하게 설명하기 위해이 글을 읽었습니다. http://www.android4devs.com/2015/12/tab-layout-material-design-support.html –

+0

@RoShanShan 이미 내 맞춤 탭 레이아웃을 사용하고 있지만 탭 항목이 위의 그림과 같이 tablayout의 테두리를 오버레이합니다. : –

+0

아래의보기를 확인하십시오 –

답변

0

사용자 정의하려고 다음과 같이 볼 수 있습니다, 당신은 당신은 사용자 정의 각 TabLayout에서 탭을 수동으로 TabLayout에 추가 할 수 있습니다 응용 프로그램

enter image description here

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="45dp" 
    android:orientation="vertical"> 

    <View android:layout_width="match_parent" 
     android:layout_height="1px" 
     android:layout_alignParentBottom="true" 
     android:layout_marginBottom="25dp" 
     android:background="@color/colorAccent"/> 

    <View android:layout_width="match_parent" 
     android:layout_height="1px" 
     android:layout_alignParentBottom="true" 
     android:background="@color/colorAccent"/> 

    <ImageView 
     android:id="@+id/imageView" 
     android:layout_width="35dp" 
     android:layout_height="35dp" 
     android:layout_centerInParent="true" 
     android:src="@drawable/ic_menu_camera" 
     android:layout_gravity="center_horizontal" 
     android:background="@android:color/white"/> 

</RelativeLayout> 
+0

다른 레이아웃을 TabLayout 위에 올려야한다는 뜻입니까? 시도해 보았지만 모범 사례입니까? 탭 항목의 위치를 ​​사용자 정의 할 수있는 방법이 있다고 생각했습니다. –

+0

아니요.이 레이아웃은 사용자 정의 레이아웃입니다. 더 복잡한 UI를 원한다면 UI를 사용할 수 있으며 TabLayout을 사용할 필요가 없다고 생각합니다. –