转载请标明出处: 
http://blog.csdn.net/lmj623565791/article/details/46767825; 
本文出自:【张鸿洋的博客】

这篇博文写得太好了,让我很激动,分享分享!

详细请前往出处 http://blog.csdn.net/lmj623565791/article/details/46767825 进行学习

我这里给出我导入时的步骤和使用方法吧!

导入步骤:

1、https://github.com/hongyangAndroid/android-percent-support-extend 下载,解压

2、在 android stdio 中导入Model

3、编译,如果出错,就根据出错的提示,把出错的信息屏蔽掉

4、使用

<?xml version="1.0" encoding="utf-8"?>

<com.zhy.android.percent.support.PercentLinearLayout

    xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

      >

    <TextView

        android:width="0dp"

        android:height="0dp"

        app:layout_heightPercent="20%"

        app:layout_widthPercent="30%"

        android:text="很好"

        android:background="@android:color/holo_blue_light"

        />

    <TextView

        android:width="0dp"

        android:height="0dp"

        app:layout_heightPercent="80%"

        app:layout_widthPercent="70%"

        android:text="你好啊"

        android:background="@android:color/holo_red_light"

        />

</com.zhy.android.percent.support.PercentLinearLayout>

屏幕适配1(Android 增强版百分比布局库 为了适配而扩展)的更多相关文章

  1. Android 增强版百分比布局库 为了适配而扩展

    转载请标明出处: http://blog.csdn.net/lmj623565791/article/details/46767825: 本文出自:[张鸿洋的博客] 一 概述 上周一我们发布了Andr ...

  2. Android 屏幕适配(二)增强版百分比布局库(percent-support-lib)

    转载请标明出处: http://blog.csdn.net/lmj623565791/article/details/46767825: 本文出自:[张鸿洋的博客] 一 概述 上周一我们发布了Andr ...

  3. Android 屏幕适配(一)百分比布局库(percent-support-lib) 解析与扩展

    转载请标明出处: http://blog.csdn.net/lmj623565791/article/details/46695347: 本文出自:[张鸿洋的博客] 一.概述 周末游戏打得过猛,于是周 ...

  4. Android 百分比布局库(percent-support-lib) 解析与扩展

    转载请标明出处: http://blog.csdn.net/lmj623565791/article/details/46695347: 本文出自:[张鸿洋的博客] 一.概述 周末游戏打得过猛,于是周 ...

  5. Android添加百分比布局库时显示Failed to resolve: com.android.support.percent:问题

    这是看第一行代码中遇到的问题,要添加百分比布局库的依赖时要在app下的bulid.gradle添加以下代码 implementation fileTree(dir:'libs',include:['* ...

  6. (转)Android Support Percent百分比布局

    一.概述 周末游戏打得过猛,于是周天熬夜码代码,周一早上浑浑噩噩的发现 android-percent-support-lib-sample(https://github.com/JulienGeno ...

  7. 腾讯优测| 让Android屏幕适配开发更简单-Google百分比布

    文/腾讯优测工程师 吴宇焕 腾讯优测优社区干货精选~ 相信开发同学都被安卓设备碎片化的问题折磨过,市面上安卓手机的主流屏幕尺寸种类繁多,给适配造成很大的困难.就算搞定了屏幕尺寸问题,各种分辨率又让人眼 ...

  8. Android Support库百分比布局

    之前写过一篇屏幕适配的文章Android 屏幕适配最佳实践,里面提到了类似百分比布局的东西,可是该方法缺点非常明显,就会添加非常多没用的数据,导致apk包变大. 而谷歌的support库中,添加了一个 ...

  9. Android百分比布局支持库(android-percent-support)

    Android中提供了五种布局,其中用的最多的就是:LinearLayout, RelativeLayout 和 FrameLayout这三种布局,在对某一界面进行布局时最先想到也是通过这三种来布局的 ...

随机推荐

  1. Appium移动自动化测试之Eclipse

    下载eclipse,这个下载方式比较多,eclipse官网,CSDN都有的下,版本根据自己操作系统选择,切记eclipse版本一定要与JDK版本一至,不然eclipse无法启动.现在我们来搭建Andr ...

  2. [转]CryptographyHelper.cs

    using System; using System.IO; using System.Security.Cryptography; using System.Text; public class C ...

  3. FMDB中 databaseWithPath 的使用问题

    阅读fmdb的源码文件(下载地址http://github.com/ccgus/fmdb)会发现下面一段注释,里面提到的创建数据库的方法也在很多博客中被引用,但是跑代码的时候发现,文件并不会像文档中所 ...

  4. 使用SVN同步资源后图标样式的详细解读

    项目视图   The Package Explorer view - 已忽略版本控制的文件.可以通过Window → Preferences → Team → Ignored Resources.来忽 ...

  5. Android消息的提示,Toast吐司方式

    1:选中某个控件进行触发 2:触发事件进行监听,然后绑定Toast对象进行消息提示 1,创建Android项目的时候,自带的一个Activity,我们看看代码 package com.example. ...

  6. 安装pillow错误的解决方案

    错误信息: ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting        ...

  7. js为空的几种情况

    1.null,对象不存在 var ii= document.getElementById("id"); alert(ii); 当前页面不存在id对象 2. undefined  v ...

  8. 用jquery编写的tab插件

    用jquery编写的tab插件 源码 $.fn.ss_tab = function (options) { var box = $(this); var btns = $(this).find(&qu ...

  9. 一个login

    login 1.获取提交表单,保存到变量中.2.判断用户密码是否正确,利用Model类.3.验证用户是否激活.3.判断用户是否记住登录状态,是的话,将其用cookie和session分别保存.没有的话 ...

  10. ServiceStack.OrmLite中的一些"陷阱"(2)

    注:此系列不是说ServiceStack.OrmLite的多个陷阱,这仅仅个人认为是某一个陷阱(毕竟我踩坑了)而引发的思考. 前文说到了项目需要使用两种不同的数据库语言,虽说前文问题已基本解决了,但是 ...