当我调试应用程序时,在调试工具窗口中有一个Watches窗口。我已经一遍又一遍地阅读了本手册,但是找不到手表的任何实用用法。
不知何故,我认为这是一个很酷且有用的工具,我缺乏不使用它的能力。
有人可以解释我什么时候应该使用它并提供一些样品吗?理想情况下,描述应与具体的(虚构的)情况相关,以便我更好地将其应用于我的工作中。
无论我使用LinearLayout还是,情况都是一样的RelativeLayout。我认为这是一个旧的Android XMl错误,但我不知道为什么它仍然存在。
即,当文本太长时,在a ImageView右侧的布局TextView可能会从屏幕上消失。它只是将其推离屏幕。我不能TextView单行。
这是XML。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="some long text blahblahblahblahblah"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="17sp"
android:layout_marginRight="10dp"
android:layout_centerVertical="true"
/>
<ImageView
android:layout_toRightOf="@+id/txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/key"
android:layout_centerVertical="true"
/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我无法使用layout_weight属性,因为图像将粘贴在屏幕的右侧。它必须在文本的右侧。
任何人有任何想法如何解决此错误?
文字长短时检查图像。在第二张图像上,文本很长,图像被推离屏幕。
我们已经分叉了一个Github项目,并且正在对其进行更改。对于每个任务,我创建一个单独的分支,然后将其合并到masterin分支中。
所以现在我要master进行的工作比master原始回购协议提前20次。
该项目的规则是create pull request for each task。
虽然,我知道该如何做,但是git我不确定该过程。
我不确定是如何为第二次提交中的任务1创建拉请求,然后为第五次提交中的任务2创建拉请求,等等。
我是否犯了一个错误,现在只能同时为多个修复程序创建提取请求?
我应该这样做吗?
完成任务
与师傅合并
创建从fork母版到原始母版的拉取请求?
编辑
@OliverCharlesworth您所建议的是我过去的工作方式,但这带来了许多问题。由于我先修复了一些任务,然后为每个任务创建了PR,所以与主服务器产生了许多冲突(徒劳)。因此,每次创建PR时,都会收到一条消息,提示它无法自动合并,但是我必须先解决冲突。然后对于90%的PR,我不得不处理合并,仅在合并时就浪费了几个小时。
这就是我认为自己做错了的原因。
因此,当我切换到规则“修复1任务然后合并到主服务器”时,我避免了所有这些愚蠢的冲突,并将我们的任务保存下来。
既然您说“从分支机构进行PR”是正确的做法,那么如何避免愚蠢的冲突并避免在愚蠢的合并过程中浪费几个小时呢?
注意:当我说“傻”时,这意味着所有冲突都将解决为必须修复的同一段代码。当我遵循新规则时,这将永远不会发生。愚蠢的意思是“没有充分理由就浪费了很多时间”。
我的主要工作工具是IntelliJ.所以我用它来为Android活动创建XML文件和布局.但是,如果我在Eclipse中打开这样的XML文件,它不会将其识别为布局文件,也不会加载其GUI设计器(我通过Eclipse Layout Editor打开XML文件).如果我在Eclipse中创建XML文件,则GUI设计器会正确加载.
Eclipse布局XML文件和IntelliJ布局XML文件的内容是100%完全相同.
我究竟做错了什么?
////////////////////////////////////////////////// ////////////
编辑:我在IntelliJ中创建了新项目.在Main.xml中添加了一些测试元素.将项目导出为Eclipse格式(File-> Export to Eclipse ...).关闭IntelliJ,打开Eclipse,导入新创建的项目,再次使用Layout Editor和NOTHING打开Main.xml.这是Main.xml的结构
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello World, MyActivity"
/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="just testing text"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/icon"/>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="test inside of layout"/>
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这就是Eclipse Layout Editor看到这个XML文件的方式.

是通过Android应用内购买禁止销售实物商品还是不推荐?
我知道运输存在问题,但是很容易通过运费来降低最终价格.如果没有运费怎么办?
请与我分享您的经历.
提前致谢
当我必须从完整图像(背景图像)创建九个补丁时,Android SDK工具draw9patch太慢了,因为它不允许从上到下快速绘制黑线(就像我们在Photoshop或Gimp中使用的那样),但我必须画每个像素.所以浪费时间.我想你知道我在说什么.
那么,有没有人试图在Photoshop/GIMP中绘制黑线,注意不要填充最终像素?Android SDK会将它们视为常规的9 PNG图像吗?
我已经回顾了一些当前最好的Android应用程序的内容(更不用说我经常检查我个人或专业使用的应用程序的内容),我发现它们不支持小屏幕.我并不是说他们的文学不支持他们通过在清单文件中排除它们.只是目录LDPI几乎为空(除了启动器图标,可能还有一些其他图标),并且布局小目录甚至不存在.
所以问题是,当现在Android设备从MDPI/NORMAL开始上升时,我们是否应该费心支持小屏幕?
这是我的XML 2 LinearLayouts.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/ll_one"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<LinearLayout
android:id="@+id/ll_two"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我从http://android.arnodenhond.com/components/graphview下载了GraphView .这个类扩展了View.我基本上想要初始化2个图表
String[] verlabels = new String[]{"aim", "25%", "50%", "75%", "start"};
String[] horlabels = new String[]{"this", "max"};
float[] values = new float[]{2.0f, 6.0f};
aaaGraphView graphView = new aaaGraphView(this, values, "Graph One",
horlabels, verlabels, aaaGraphView.BAR);
float[] values2 = new float[]{1.0f, 12.0f};
aaaGraphView graphView2 = new aaaGraphView(this, values2, "Graph Two",
horlabels, verlabels, aaaGraphView.BAR);
Run Code Online (Sandbox Code Playgroud)
然后膨胀graphView到ll_one,graphView2 …
android graph android-linearlayout android-inflate layout-inflater
这是基本的XML文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@color/white"
>
<!--top part-->
<include layout="@layout/top" android:layout_width="fill_parent"
android:layout_height="0dp" android:layout_weight="1"/>
<!--content area-->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:background="#ff6600"
>
</LinearLayout>
<!--bottom part-->
<include layout="@layout/bottom" android:layout_width="fill_parent"
android:layout_height="0dp" android:layout_weight="1"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
当我在模拟器中加载它时,它看起来像在下面的图像.

我究竟做错了什么?
编辑
这是顶部和底部的XML.基本也是.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/bottom_image"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:adjustViewBounds="true"
android:src="@drawable/bottom"
/>
</LinearLayout>
-----------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/top_image"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:adjustViewBounds="true"
android:src="@drawable/top"
/>
Run Code Online (Sandbox Code Playgroud)
Android和Blackberry应用程序都是用Java制作的.这是否意味着我可以编写一些与Android SDK相互依赖的逻辑,并在将应用程序移植到Blackberry时使用它?
有没有人有这个领域的经验?
android ×8
blackberry ×1
eclipse ×1
gimp ×1
git ×1
github ×1
graph ×1
nine-patch ×1
photoshop ×1
pull-request ×1