一、碎片化
1.碎片:是一種可以在嵌入在活動當中的UI片段,他能讓程式更加合理和充分的利用大螢屏空間,因為在平板電腦上應用的非常廣泛,
2.先設定一個左邊的
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="Button" /> </LinearLayout>
? <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:textSize="20sp" android:text="This is right fragment" /> </LinearLayout> ?
package com.example.fragmenttest; import android.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.os.Bundle; ? ? public class LeftFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) { View view = inflater.inflate(R.layout.left_fragment,container,false); return view; } ? }
我們先寫一個框架,下次連載在曬出想要的結果
另外
print('\n'.join([''.join([('Love'[(x-y) % len('Love')] if ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3 <= 0 else ' ') for x in range(-30, 30)]) for y in range(30, -30, -1)]))

二、原始碼:
1.專案地址
https://github.com/ruigege66/Android/tree/master/UIBestPractice
2.CSDN:https://blog.csdn.net/weixin_44630050
3.博客園:https://www.cnblogs.com/ruigege0000/
4.歡迎關注微信公眾號:傅里葉變換,個人公眾號,僅用于學習交流,后臺回復”禮包“,獲取大資料學習資料

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/11376.html
標籤:Android
