如何在Android的EditText视图中允许多行?
什么是
@id/和@+id/?之间的差异?
在@+id/加号中+指示创建一个新的资源名称并添加到该R.java文件但是怎么样@id/?从以下文档ID:引用Android资源时ID,您不需要加号,但必须添加android包命名空间,如下所示:
android:id="@android:id/list"
Run Code Online (Sandbox Code Playgroud)
但是在下面的图像中,Eclipse没有提出任何建议@android:id/.

是
@id/和@android:id/一样吗?
是否可以在字符串值中包含占位符string.xml,可以在运行时分配值?
例:
一些字符串PLACEHOLDER1更多字符串
我是Android新手.我想知道Looper课程的作用以及如何使用它.我已阅读Android Looper类文档,但我无法完全理解它.我在很多地方都看过它但却无法理解它的目的.任何人都可以通过定义目的来帮助我,Looper并且如果可能的话也给出一个简单的例子吗?
在开发Android应用程序时,Min和Target SDK版本有什么区别?除非Min和Target版本相同,否则Eclipse不会让我创建一个新项目!
从Android 4.3(Jelly Bean)开始,我们现在可以利用这些res/mipmap文件夹来存储"mipmap"图像.
例如,Chrome for Android将其图标存储在这些文件夹中,而不是更常用的res/drawable文件夹中.
这些mipmap图像与其他熟悉的可绘制图像有何不同?
我看到在我的清单中,我们使用@mipmap/限定符,而不是@drawable/,这对于资源文件夹名称是有意义的:
<activity
android:name=".MipmapDemp"
android:icon="@mipmap/ic_launcher" />
Run Code Online (Sandbox Code Playgroud)
在Android 4.3的API的文档具有下面要说:
使用mipmap作为位图或drawable的源是提供高质量图像和各种图像比例的简单方法,如果您希望在动画期间缩放图像,这可能特别有用.
Android 4.2(API级别17)在Bitmap类中添加了对mipmap的支持 - 当您提供了mipmap源并启用了setHasMipMap()时,Android会在您的Bitmap中交换mip图像.现在在Android 4.3中,您还可以通过提供mipmap资源并在位图资源文件中设置android:mipMap属性或通过调用hasMipMap()来为BitmapDrawable对象启用mipmaps.
我没有看到任何有助于我理解的东西.
XML Bitmap资源具有以下android:mipMap属性:
布尔.启用或禁用mipmap提示.有关更多信息,请参见setHasMipMap().默认值为false.
就我所见,这不适用于启动器图标.
问题出现在Google网上论坛(资源名称"mipmap"的目的?!)上,Romain Guy回复道:
提供通常可以计算的更大分辨率的图像很有用(例如,在mdpi设备上,Launcher可能希望更大的hdpi图标显示大型应用程序快捷方式.)
我觉得这几乎是有意义的,但并不完全.
我仍然倾向于选择Randy Sugianto的跟进:
这有什么好处?是否有任何指南如何使用mipmap,可能是为了更好的启动器图标?
当然,维基百科有一个"Mipmap"页面,它指的是一种1983年发明的旧技术,我无法与当前的Android实现相关联.
我们现在应该将所有应用程序图标res/mipmap存储在文件夹中吗?这些mipmap图像的准则是什么?
更新#1
这是一篇博文,试图解释一下.
但是该博客文章中使用的图像显示了一个包含许多徽标的文件.这不是我在Chrome的mipmap文件夹中看到的.
Chrome的mipmap-hdpi文件夹包含三张图片.一个是Chrome徽标,单独使用.

奇怪的是,它是72x72,而不是48x48,我希望看到.
也许这就是全部 - 我们只需要在mipmap文件夹中保留更大的图标?
更新#2
2014年10月23日的Android开发者博客文章再次证实了将mipmap文件夹用于应用程序图标的想法:
如何获取屏幕宽度和高度并在以下位置使用此值:
@Override protected void onMeasure(int widthSpecId, int heightSpecId) {
Log.e(TAG, "onMeasure" + widthSpecId);
setMeasuredDimension(SCREEN_WIDTH, SCREEN_HEIGHT -
game.findViewById(R.id.flag).getHeight());
}
Run Code Online (Sandbox Code Playgroud) 我正在为Activity我的Android应用程序中的登录工作.下面的图片是我希望它看起来像:

我能够使用以下XML实现此布局.问题是,它有点hackish.我不得不为主机EditText硬编码宽度.具体来说,我必须指定:
android:layout_width="172dp"
Run Code Online (Sandbox Code Playgroud)
我真的想给主机和端口EditText提供一个百分比宽度.(主机为80%,端口为20%.)这可能吗?以下XML适用于我的Droid,但似乎并不适用于所有屏幕.我真的想要一个更强大的解决方案.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/host_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/home"
android:paddingLeft="15dp"
android:paddingTop="0dp"
android:text="host"
android:textColor="#a5d4e2"
android:textSize="25sp"
android:textStyle="normal" />
<TextView
android:id="@+id/port_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/home"
android:layout_toRightOf="@+id/host_input"
android:paddingTop="0dp"
android:text="port"
android:textColor="#a5d4e2"
android:textSize="25sp"
android:textStyle="normal" />
<EditText
android:id="@+id/host_input"
android:layout_width="172dp"
android:layout_height="wrap_content"
android:layout_below="@id/host_label"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="4dp"
android:background="@android:drawable/editbox_background"
android:inputType="textEmailAddress" />
<EditText
android:id="@+id/port_input"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_below="@id/host_label"
android:layout_marginTop="4dp"
android:layout_toRightOf="@id/host_input"
android:background="@android:drawable/editbox_background"
android:inputType="number" />
<TextView
android:id="@+id/username_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/host_input"
android:paddingLeft="15dp"
android:paddingTop="15dp"
android:text="username"
android:textColor="#a5d4e2"
android:textSize="25sp"
android:textStyle="normal" />
<EditText
android:id="@+id/username_input"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/username_label"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="4dp"
android:background="@android:drawable/editbox_background" …Run Code Online (Sandbox Code Playgroud)