0
ActionBarDrawerToggle 아이콘 (햄버거)을 화면 가장자리에 유지하고 싶습니다.ActionBarDrawerToggle에 패딩
가장자리에 아이콘을 유지하는 방법 (기본적으로 공백 없음).
ActionBarDrawerToggle 아이콘 (햄버거)을 화면 가장자리에 유지하고 싶습니다.ActionBarDrawerToggle에 패딩
가장자리에 아이콘을 유지하는 방법 (기본적으로 공백 없음).
,하지만 ...
사실 마이크는 여기 Get reference to drawer toggle in support actionbar이미 비슷한 질문에 대답 난 그냥 자신의 코드를 재사용. 당신이 ActionBarDrawerToggle을 추가하고 그 위에 syncState()를 호출 한 후
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(...);
//Setting the actionbarToggle to drawer layout
drawerLayout.setDrawerListener(actionBarDrawerToggle);
//calling sync state is necessay or else your hamburger icon wont show up
actionBarDrawerToggle.syncState();
당신은
for (int i = 0; i < toolbar.getChildCount(); i++) {
if(toolbar.getChildAt(i) instanceof ImageButton) {
ImageButton imageButton = (ImageButton) toolbar.getChildAt(i);
imageButton.setPadding(50, 100, 50, 50);
}
}
는 희망이
당신이 패딩을 설정 봤어 도움이 ... 다음 도구 모음의 아이들을 반복 할 수 ? –
솔직히 말해서, 그렇게하면 추한 것처럼 보일 것입니다. 그러나, 당신이 원한다면,'ImageButton'에 대한 참조를 얻을 수 있습니다. 그러면 왼쪽 패딩, x 좌표 등을 변경할 수 있습니다. 또는 툴바에서 직접 토글을 만들고 원하는대로 설정할 수 있습니다. –
안녕하세요, 마이크, 네, 추한 것처럼 보일 수도 있지만 그게 필수 요건입니다. ActionBarDrawerToggle 아이콘 리소스의 참조를 가져올 수 있습니까? – Annada