2016-06-15 5 views
1

코드에서 팹의 위치를 ​​설정할 수 있습니까?플로팅 동작 버튼의 위치 지정

예를 들어 나는이 2 개 개의 팹이 : 나는 빈 작업을 만든 후

FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); 
FloatingActionButton editFab = (FloatingActionButton) findViewById(R.id.editFab); 

"공장"기본 팹이며, 그 예로서 제공 및 editFab 내 공장

<android.support.design.widget.FloatingActionButton 
     android:id="@+id/editFab" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom" 
     android:layout_margin="16dp" 
     android:clickable="true" 
     /> 

enter image description here입니다

코드에서 "fab"버튼 위에 "editFab"을 배치 할 수 있습니까? 아니면 XML 레이아웃에서해야합니까?

+0

팹 위에 왜 넣으시겠습니까 ?? 왜'fab'을 사용하지 않으시겠습니까 ?? –

+2

@jankigadhiya 2 개의 팹을 보유하고 싶습니다. –

+1

팹을 관련 레이아웃에 추가하고 원하는 위치에 배치하고 싶습니다. –

답변