我正在使用Android Fragments.我想达到以下效果.
我有2个碎片细节和一个主体.在按钮上单击我希望细节面板向下滑动并平移主体的一部分.
详细信息面板未在活动的xml布局中声明.它是动态添加的.当用户完成时,细节面板也可以被解雇.
我找到了一个我想要做的事情的例子.当您在Xoom上以纵向模式使用时,Gmail中的Gmail应用程序会执行此操作.一直导航到一封电子邮件,使其占据整个屏幕.按后退按钮,注意右侧的电子邮件正文平移,为电子邮件消息列表腾出空间.

我正在阅读此文档页面,http://developer.android.com/reference/android/util/Log.html.
这部分引起了我的注意:
提示:当你拨打电话时不要忘记
Log.v(TAG, "index=" + i);当您构建要传递给Log.d的字符串时,编译器使用StringBuilder并且至少发生三次分配:StringBuilder本身,缓冲区和String对象.实际上,还有另一个缓冲区分配和复制,对gc的压力更大.这意味着如果您的日志消息被过滤掉,那么您可能正在进行大量工作并产生大量开销.
这意味着Android编译器正在采用字符串连接(+)并将它们转换为StringBuilder和append语句.
我的假设是正确的还是更好地手动使用StringBuilder而不是字符串连接?
我正在使用ListView和RelativeLayout行项目进行布局.lineitems本身无法正确显示.
问题是txtVideoDuration TextView是在行项目的顶部而不是在底部绘制的.因此,txtVideoTitle的高度为0.正如您在XML中看到的那样,txtVideoDuration应该被限制在ListView的底部.
我的目标是使布局类似于谷歌给我的教程.示例:http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html
我正在使用Android 2.0.1.我甚至插入了示例布局而不修改ListView并发生相同的行为.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip">
<ImageView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/imgVideoThumbnail"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:minHeight="64dip"
android:layout_marginRight="6dip"
android:src="@drawable/icon" />
<TextView
android:id="@+id/txtVideoDuration"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:layout_toRightOf="@+id/imgVideoThumbnail"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:singleLine="true"
android:ellipsize="marquee"
android:text="0:00:00" />
<TextView
android:id="@+id/txtVideoTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/imgVideoThumbnail"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_above="@+id/txtVideoDuration"
android:layout_alignWithParentIfMissing="true"
android:gravity="center_vertical"
android:text="[Title]"
android:textColor="#FFFFFF" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
这个简单的案例有效.这是活动的根XML布局.顶部的错误代码是列表视图中的行项目.似乎ListView本身正在打破它.
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:id="@+id/listVideoCatalog"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<TextView
android:id="@+id/txtName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="Hello World" />
</RelativeLayout>
</merge>
Run Code Online (Sandbox Code Playgroud)
这是将订单项膨胀到ListView中的getView代码.
static class …Run Code Online (Sandbox Code Playgroud) 我想创建一个类似于Google+应用通知的通知图标视图.不同之处在于我需要能够在运行时更改颜色,因为Google+图标为灰色或红色,所以我假设他们正在使用StateListDrawable.
对此最好的方法是什么?我更喜欢圆角的夹角,并且可以选择内部有一个可绘制的.此自定义视图也将放置在操作栏中.我仍然需要视图响应android:背景状态列表drawables所以我可以点击和选择按照工作.
此自定义视图也将放置在操作栏中.

我需要在我的应用程序中加入语法高亮编辑器控件.要求控件是免费的本机.NET代码,因此Scintilla.NET控件不可行.原因是因为它是ClickOnce应用程序.
我想要使用WinForms或WPF的答案.它不必来自同一供应商.它需要基本上支持语法高亮,行号,并且对于高达100,000的大型文件来说速度相当快,必须是免费的!
我知道之前已经问过这个问题,因为它们通常混淆了需要版税或不免费的商业控件,或者提到不是本机.NET代码的Scintilla.NET控件.
我需要创建一个ListAdapter来呈现来自多个ContentProviders的数据.ContentProviders本身代表一个来自关系数据库的表.
我想使用CursorLoader系统将聚合数据检索到ListView中.这可能与1个装载机有关,还是需要使用多个装载机?我宁愿用一个.
我不确定除了在代码中手动连接之外我怎么能让2个ContentProviders互相交互,这似乎也不是一个很好的选择.
database android listadapter android-contentprovider android-cursorloader
让我们说我想定义2种风格.
.color_red { color: Red; }
.banner { display: block; width: 100%; }
Run Code Online (Sandbox Code Playgroud)
有没有办法可以让h1样式继承color_red样式?我不想这样做
<div class="banner color_red">This is my banner.</div>
Run Code Online (Sandbox Code Playgroud)
我宁愿做这样的事......
.banner { ... inherit: color_red; }
...
<div class="banner">This is my banner.</div>
Run Code Online (Sandbox Code Playgroud)
并且横幅有红色文字.
是否有一个工具可以扫描您的代码并确定实现IDisposable的哪些对象在编译时或运行时没有被置于代码库中?
我在代码中有可能没有处理对象的区域,但是很难回头看看哪些对象首先需要它.
我正在尝试使用Proguard对付我的应用程序,最终将整合LVL和应用程序内结算.我遇到的问题是Proguard在启动时不断崩溃我的应用程序,很难弄清楚什么是失败的.
我正在使用Android V4支持兼容库,它似乎正在吹走该库以及其他一些东西.
有没有人有一个proguard.cfg适用于初学者的v4 compat库的基本版本?
目前我使用的股票proguard.cfg不起作用.
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public …Run Code Online (Sandbox Code Playgroud) android proguard android-lvl android-fragments android-support-library
我有这个XML布局.frame_top_widget_holo是一个9-patch drawable,底部和右侧有填充线.它还在顶部和左侧有拉伸边界线.它被设置为背景,有一个图像可绘制集作为源.结果显示两者,但src图像与drawable设置的填充重叠.问题是scaleType,所以我怀疑这可能是一个错误.有谁知道如何解决这个问题?
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:scaleType="centerCrop"
android:background="@drawable/frame_top_widget_holo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/bigpicture" />
Run Code Online (Sandbox Code Playgroud) android ×7
.net ×2
android-lvl ×1
css ×1
custom-view ×1
database ×1
editor ×1
idisposable ×1
listadapter ×1
nine-patch ×1
proguard ×1
string ×1
winforms ×1
wpf-controls ×1