Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- It
- XML
- cookie
- 제네릭
- IT 관련
- angularJS
- LINQ
- delegate
- 디자인패턴
- di
- Generic
- jQuery
- JavaScript
- MSSQL
- Excel
- 클래스
- asp.net mvc
- ASP.NET
- 메소드
- mvc
- SQL
- 구글
- ADO.NET
- csv
- 동적dom
- IT관련
- iframe
- c#
- Today
- 365
- Total
- 1,440,084
심재운 블로그
xamarin 자마린 ActionBarActivity 에서 AppCompatActivity 변경 주의사항 본문
ActionBarActivity 가 롤리팝 버전부터 지원을 하지 않고 AppCompatActivity 를 상속 받아 사용해야 합니다.
public class MainActivity : AppCompatActivity //ActionBarActivity { }
기존에 ActionBarActivity 을 사용하게 되면 아래 함수 중에 SetDrawerListener() 함수가 존재하며, 바인딩 하면 햄버거? 아이콘이 좌측에 나오도록 기술이 가능했는데요.
mDrawerToggle = new MyActionBarDrawerToggle( this, //Host Activity mDrawerLayout, //DrawerLayout Resource.String.openDrawer, //Opened Message Resource.String.closeDrawer //Closed Message ); mDrawerLayout.SetDrawerListener(mDrawerToggle); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(true); mDrawerToggle.SyncState();
AppCompatActivity 로 작업을 하게 되면, 아래 처럼 SetDrawerListener() 함수 대신에 AddDrawerListener() 함수로 대체를 해야 하며, SetDisplayHomeAsUpEnabled(true); 함수를 추가로 호출해야 기존과 동일하게 작동되는것을 확인할 수 있습니다.
mDrawerToggle = new MyActionBarDrawerToggle( this, //Host Activity mDrawerLayout, //DrawerLayout Resource.String.openDrawer, //Opened Message Resource.String.closeDrawer //Closed Message ); mDrawerLayout.AddDrawerListener(mDrawerToggle); //setDrawerListener is deprecated SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); //꼭 사용해삼.!!! 함버거 마크 활성화 할려면~ mDrawerToggle.SyncState();
참고 자료 :
http://apphappy.tistory.com/10
'모바일관련 > Xamarin' 카테고리의 다른 글
Xamarin.Android.Support.Compat 24.2.1 패키지를 설치할 수 없습니다. 해결방법 (0) | 2016.11.22 |
---|---|
자마린 xamarin 의 웹서비스를 통해 json 비동기 가져오기 (0) | 2016.11.22 |
xamarin 자마린 ActionBarActivity 에서 AppCompatActivity 변경 주의사항 (0) | 2016.11.22 |
xamarin 의 안드로이드 Android 플렛폼 별 설치 하는 방법 (0) | 2016.11.16 |
자마린 XAMARIN 오류 발생 : major version 52 is newer than 51, the highest major version supported by this compiler. (0) | 2016.11.09 |
자마린 XAMARIN 의 AXML 열리지 않을 경우 (0) | 2016.11.09 |
0 Comments