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

     

  • 相关阅读:
    shell 如何避免误删目录
    Linux 禁止用户或 IP通过 SSH 登录
    gitlab不能启动了
    清空分区表里某个分区的数据
    mysql错误Table ‘./mysql/proc’ is marked as crashed and should be repaired
    MySQL Server参数优化
    linux下删除乱码文件、目录
    ERROR 1044 (42000): Access denied for user 'root'@'localhost'
    awk 打印从某一列到最后一列的内容
    连接和关闭资源工具类
  • 原文地址:https://www.cnblogs.com/ruigege0000/p/12735259.html
Copyright © 2020-2023  润新知