简体   繁体   English

在 Android 应用程序中实现设计的最佳方法?

[英]Best way to implement design in Android Application?

I am currently developing an Android Application for a company who are set on having this type of design and targeting Hires devices however I have found that this is very difficult to do and on some hires devices buttons start to stretch.我目前正在为一家致力于拥有此类设计并针对 Hires 设备的公司开发 Android 应用程序,但是我发现这很难做到,并且在某些租用设备上的按钮开始伸展。

Screen design here: https://skitch.com/aaronwardle/r7kwa/screen此处的屏幕设计: https://skitch.com/aaronwardle/r7kwa/screen

A few people have recommended making the buttons into Nine Patch PNG files which help with the various screen layouts.一些人建议将按钮制作成九个补丁 PNG 文件,这有助于各种屏幕布局。

Should I try and get a new app design for this project, which fits all screens using standard controls, or do you think this is achievable?我应该尝试为这个项目设计一个新的应用程序设计,它适合所有使用标准控件的屏幕,还是你认为这是可以实现的?

Looking at stats the most common devices are small screen ones, so creating this application may have a limited audience.查看统计数据,最常见的设备是小屏幕设备,因此创建此应用程序的受众可能有限。

If any one has any pointers on what I could do, ie could I make this for hi res screens and within the application have a different layout for smaller screens?如果有人对我可以做什么有任何指示,即我可以为高分辨率屏幕制作这个并且在应用程序中为较小的屏幕设置不同的布局吗?

Thanks Aaron!谢谢亚伦!

Your question is too generic to give a simple and quick answer.您的问题太笼统,无法简单快速地回答。 Furthermore, the layout you want to make is complex and very non-native-looking which complicates matters.此外,您想要制作的布局很复杂并且看起来非常非本地化,这使事情变得复杂。 Please make sure you read and understand the official docs on the subject from HERE .请确保您从这里阅读并理解有关该主题的官方文档。 There is no replacement for that...没有替代品...

The main points that come to mind from that document are:从该文件中想到的要点是:

  1. the <supports-screens> manifest item <supports-screens>清单项
  2. Resource directory qualifiers for screen size and density.屏幕大小和密度的资源目录限定符。 Appending stuff such as -small or -portrait allows you to create resources that are loaded only on a particular screen aspect, size or DPI.附加诸如-small-portrait之类的内容允许您创建仅在特定屏幕方面、大小或 DPI 上加载的资源。 For example, you can create bigger images for bigger screens, or change the layout XMLs for portrait or landscape例如,您可以为更大的屏幕创建更大的图像,或者将布局 XML 更改为纵向或横向
  3. Use 9-patch images to scale up rectangles (buttons).使用 9-patch 图像放大矩形(按钮)。

Best practices (as recommended by Google):最佳做法(由 Google 推荐):

  1. Use wrap_content, fill_parent, or the dp unit, instead of absolute pixels使用 wrap_content、fill_parent 或 dp 单位,而不是绝对像素
  2. Avoid AbsoluteLayout避免绝对布局
  3. Do not use hard-coded pixel values in your code不要在代码中使用硬编码的像素值
  4. Use density and/or size-specific resources使用密度和/或尺寸特定的资源

I know my answer is a bit generic, but then again, so is your question...我知道我的回答有点笼统,但话又说回来,你的问题也是...

You have to use 9 patch png and also will have to make some changes in the manifest file, to make it screen resolution free.您必须使用 9 补丁 png 并且还必须在清单文件中进行一些更改,以使其屏幕分辨率免费。 These are very less changes in the manifest file so would not be a trouble.这些是清单文件中非常少的更改,因此不会有问题。

You can use 9 patch images as well as to design application for different resolutions, you can create different layouts for landscape and portrait.您可以使用 9 个补丁图像以及设计不同分辨率的应用程序,您可以为横向和纵向创建不同的布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 哪个是在Android中实现Material Design菜单的最佳方式? - Which is the best way to implement Material Design menus in Android? 在Android应用程序中实现客户端&lt;-&gt;服务器&lt;-&gt;数据库体系结构的最佳方法? - Best way to implement Client <-> Server <-> Database architecture in an Android application? 在Android应用程序中实现弹出窗口的最佳方法 - best way to implement pop up window in android application 在社交网络Android应用程序中实现不同用户类型的最佳方法 - Best way to implement different user types in a social network Android application 在 android 中实现基于 Web 的应用程序的最佳方式 - Best way to implement a web-based application in android 在Android中实现观察者设计模式的最佳过程 - Best procedure to implement observer design pattern in Android 在Android中实现Timer的最佳方式? - Best way to implement Timer in Android? android-放置对象/设计活动的最佳方法 - android - best way to place objects / design an activity Android用户界面设计-整合的最佳方法? - Android User Interface Design - Best way to integrate it? 在Android中设计资源的最佳方法是什么 - What is the best way to design Resources in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM