如何让Android GridLayout的兼容旧版本? [英] How to make Android GridLayout compatible to older version?

查看:438
本文介绍了如何让Android GridLayout的兼容旧版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的网格布局作为安卓4.0还是不错的。无论是在code可维护性和性能。

New GridLayout for Android 4 is good. Both in terms of code maintainability and performance.

我想与GridLayout的向后兼容旧版本的帮助。等待官方compatibile包的时间太长。我知道它有可能和别人没有提及,这可能从第4版平台源复制类来完成。

I wanted help with backward compatibility for GridLayout for older version. Waiting for official compatibile package is taking too long. I know its possible and someone did mention that this could be done by copying the class from version 4 platform source.

将是非常巨大的,如果有人能指导我如何做到这一点。

Would be really great if anybody could guide me how to do this.

有关参考,请查看这篇文章在谷歌加 <一href="https://plus.google.com/105051985738280261832/posts/KbqAxUQTzVf">https://plus.google.com/105051985738280261832/posts/KbqAxUQTzVf

For reference please check this post on Google Plus https://plus.google.com/105051985738280261832/posts/KbqAxUQTzVf

推荐答案

这样做的更好的方法是采用Android支持库。 因为资源文件也涉及它不能被包括作为的.jar文库

A better way of doing this is using Android Support Library. Since resource files are also involved it cannot be included as .jar library.

更新的Andr​​oid SDK和支持文件。

Update the android SDK and support files.

  1. 添加您-Android的SDK \演员\机器人\ SUPPORT \ V7 \网格布局项目偏食。
  2. 请以项目为库。
  3. 将此库项目,以你的工作项目。
  1. Add your-android-sdk\extras\android\support\v7\gridlayout project to eclipse.
  2. Make the project as library.
  3. Add this library project to your working project.

要使用网格布局在XML中使用这样

To use gridlayout in XML use it like this

<android.support.v7.widget.GridLayout> </android.support.v7.widget.GridLayout>

希望这是有帮助的。

Hope that was helpful.

这篇关于如何让Android GridLayout的兼容旧版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆