zoukankan      html  css  js  c++  java
  • Android连载6-碎片

    一、碎片化

    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('
    '.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.欢迎关注微信公众号:傅里叶变换,个人公众号,仅用于学习交流,后台回复”礼包“,获取大数据学习资料

     

  • 相关阅读:
    golang 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。
    BITOP operation destkey key [key ...]
    Viscosity for Mac使用创建您的第一个连接的方法
    ubuntu18没有网络连接Network
    go1.14下Go mod使用实践
    Unity 光照系统
    Unity 单例模式
    Unity 回调函数(Callback)
    Unity 基于OnGUI显示实时FPS
    Unity OnGUI 的可视化编辑
  • 原文地址:https://www.cnblogs.com/ruigege0000/p/12735259.html
Copyright © 2011-2022 走看看