Android Studio笔记
生活随笔
收集整理的這篇文章主要介紹了
Android Studio笔记
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1. toolbar
xml:
<android.support.v7.widget.Toolbarandroid:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
?
java:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setTitle("Horizontal TimeLine");
Recyckerview add items
?
//add dataTimeLineModel model = new TimeLineModel();
model.setDate("test\ntest");
// add in listview
controller.mDataList.add(model);
// length of list
int num = controller.mDataList.size() - 1;
// Notify the adapter that an item inserted
controller.mTimeLineAdapter.notifyItemInserted(num);
原帖:http://blog.sina.com.cn/s/blog_5d5996d001012j7p.html
如果說你把屏幕設置豎屏的時候,Android提供的SDK(android.hardware.Camera)里大概不能正常的使用豎屏(portrait layout)加載照相機,當用豎屏模式加載照相機時會產生以下情況:. 照相機成像左傾90度(傾斜);
目前在百度google上搜到的最多的答案就是設置 parameters.set("orientation", "portrait");或者設置 parameters.set("rotation", 90); 經過實踐測試發現都沒有效果。后來發現了一種方法可以這樣子做:在聲明的camera實例中設置 mCamera.setDisplayOrientation(90);這個參數,可以很好解決豎屏的時候,攝像頭旋轉90度的問題。這個郁悶了比較久的時間,也很無奈,終于解決了。。希望可以幫到大家!!!
轉載于:https://www.cnblogs.com/adelaide/p/6404127.html
總結
以上是生活随笔為你收集整理的Android Studio笔记的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: POJ 3172 (认真读题的题)
- 下一篇: React Native工程修改Andr