草庐IT

bg-content

全部标签

android - 如何使用 ConstraintLayout 制作 View "wrap_content but not larger than"?

我连续有3个View:标题、版本和ImageView(用作按钮):title应该是wrap_content但要遵守以下规则版本应该是wrap_content,在标题的右边和imageview的左边imageview大小固定,位于父级的右上角问题是如果标题太大,版本向右移动并且不遵守规则“版本在imageview的左侧”:所以我需要限制标题宽度并使版本可见而不向右移动。这里是XML:PS1.layout_width="0dp"+app:layout_constraintWidth_default="wrap"似乎正是我所需要的(“wrap_content但不破坏约束”)但它不起作用(仍然

android.content.ActivityNotFoundException : Unable to find explicit activity class

我收到此错误:06-0610:45:19.685:E/AndroidRuntime(554):android.content.ActivityNotFoundException:Unabletofindexplicitactivityclass{com.Android.myApp/com.Android.myApp.Facebook.Example};haveyoudeclaredthisactivityinyourAndroidManifest.xml?但是我已经在我的list文件中声明了它。这种异常的其他原因可能是什么?我的list.xml 最佳答案

Android - 为什么这告诉我 "Content view not yet created"?

这是在数据库fragment上填充ListView:publicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState){LinearLayoutLayout5=(LinearLayout)inflater.inflate(R.layout.tab_frag5_layout,container,false);CursorallBands;MyDatabasedb;Contextctx=(Context)TabFragment5.this.getActivity();db=ne

android - 由: java. lang.NoSuchMethodException : <init> [class android. content.Context,接口(interface)android.util.AttributeSet引起]

我在运行应用程序时收到此错误。错误:Causedby:java.lang.NoSuchMethodException:[classandroid.content.Context,interfaceandroid.util.AttributeSet]atjava.lang.Class.getConstructorOrMethod(Class.java:472)atjava.lang.Class.getConstructor(Class.java:446)atandroid.view.LayoutInflater.createView(LayoutInflater.java:574)ata

android - 使用 KitKat 存储访问框架后打开 Google Drive File Content URI

我正在使用适用于android4.4的存储访问框架并打开文件选择器。除了从GoogleDrive中选择文件外,一切正常,我只能弄清楚如何将其作为输入流打开,但我想获得一个javaFile对象。返回的内容uri如下所示:content://com.google.android.apps.docs.storage/document/acc%3D4%3Bdoc%3D2279其他类似但没有可让我获取文件名、文件大小和内容的有效解决方案的问题:GetrealpathfromURI,AndroidKitKatnewstorageaccessframeworkAndroidGalleryonKitK

Android studio 编译错误 "Content is not allowed in prolog"

我使用最新的AndroidStudio0.8.4(适用于OSX),在“res”目录中创建新的“database”目录并将所有需要的文件放在那里,当我尝试编译时收到此错误。Error:Contentisnotallowedinprolog.:app:mergeDebugResourcesFAILED/Users/filipp/data/Android_dev/project/app/src/main/res/database/5clSubject0Book0.txtError:Error:Contentisnotallowedinprolog.Error:Executionfailedf

android - 将 'wrap_content' 或 '-2' 分配给维度

我想创建一个等于“wrap_content”常量的维度。所以根据developer.android.comReference我写:-2但是ADT说:Error:Integertypesnotallowed(at'horizontal_border_height'withvalue'-2')分配'wrap_content'值也会产生错误。我做错了什么?任何想法如何使它工作? 最佳答案 要使用wrap_content或match_parent,您需要在dimens.xml文件中创建以下项目:-1-2那么你可以像这样简单地使用它:@dim

android - ScrollView中的最小高度fill_parent和高度wrap_content? (或者只是电子邮件应用程序编写布局的代码)

问题如果我有以下问题:如何让正文(第二个EditText)填满屏幕的其余部分,但当正文的内容太长时,ScrollView仍会启动?像height="wrap_content"和minHeight="fill_parent"layout_height="fill_parent"如果将它们放在ScrollView中,似乎什么也没做我想要的一个工作示例是电子邮件应用撰写窗口我试过了,EditText元素的行为就像它们是wrap_content并且没有发生填充。如果你输入的足够多,只需滚动 最佳答案 我发现了一个指向mailappsourc

android - ACTION_GET_CONTENT 和 ACTION_OPEN_DOCUMENT 之间的真正区别是什么?

我很难理解ACTION_OPEN_DOCUMENT和ACTION_GET_CONTENTIntent用于打开可打开文档时之间的区别。如果我在KitKat之前支持Andriod,它不支持ACTION_OPEN_DOCUMENT,我应该选择ACTION_GET_CONTENT吗?documentation是这样说的:ACTION_OPEN_DOCUMENTisnotintendedtobeareplacementforACTION_GET_CONTENT.Theoneyoushouldusedependsontheneedsofyourapp:UseACTION_GET_CONTENTif

android - 使用 wrap_content 展开 TextView 直到邻居 View 到达父 View 的末尾

我需要实现如下布局:我有两个相对布局的TextView:绿色的是带有wrap_content的固定文本,黑色的是带有wrap_content的动态文本。黑色文本可以更改并变得很长。我希望黑色TextView与文本一起扩展,直到绿色View到达父级的末尾。如果发生这种情况,黑色的TextView应该停止扩展并椭圆化结束。我怎样才能做到这一点?我尝试了什么:但是当黑色文本变得越来越大时,它会将绿色文本推出View 最佳答案 您可以通过TableLayout和shr​​inkColumns属性来归档此布局。Here是同一个问题;)