草庐IT

child_name

全部标签

android - ConstraintLayout 测量它的每个 child 多少次?

RelativeLayout测量其所有子项两次。这可能会导致性能问题。约束布局是否只测量其子节点一次? 最佳答案 ConstraintLayout最多需要两次测量。如果您查看ConstraintLayout的源代码,您会看到它的onMeasure()方法首先在internalMeasureChildren()实用方法。接下来,它评估一些约束。最后,ConstraintLayout在循环内第二次对其子项调用child.measure()。来源:反编译的类文件,因为此时源不可用。 关于and

yolov8运行出错及解决,No module named ‘ultralytics‘和ImportError: Failed to initialize: Bad git executable

成功解决Nomodulenamed'ultralytics’和Failedtoinitialize:Badgitexecutable的问题,以此记录和分享。问题:ModuleNotFoundError:Nomodulenamed'ultralytics'解决:在文件开头开间绝对路径,即ultralytics文件夹所在的文件夹路径。问题:ImportError:Failedtoinitialize:Badgitexecutable.Thegitexecutablemustbespecifiedinoneofthefollowingways:-beincludedinyour$PATH-beset

android - ionic 3 : more than one library with package name 'com.google.android.gms.license'

这个问题在这里已经有了答案:Error:morethanonelibrarywithpackagenamecom.google.android.gms.license(15个答案)关闭4年前。我有这个错误:Executionfailedfortask':processDebugResources'.Error:morethanonelibrarywithpackagename'com.google.android.gms.license'当我跑完ioniccordovarunandroid这是ionic信息:clipackages:(AppData\Roaming\npm\node_m

android - 在项目 'Android Package Builder' 上运行生成器 'HelloAndroid' 时出错。 sun/security/x509/X500Name

我刚刚安装了Eclipse-Classic3.7.2和androidSDK。还使用ADT插件安装/配置了eclipse。现在在执行了http://developer.android.com/resources/tutorials/hello-world.html中的步骤之后为了创建“HelloWorld”应用程序,我尝试在Android模拟器中运行该应用程序。但这是抛出一个错误Errorsoccurredduringthebuild.Errorsrunningbuilder'AndroidPackageBuilder'onproject'HelloAndroid'.sun/securi

android - 错误 : No resource found that matches the given name

在此文件中是我的布局,此代码中显示以下错误error:Error:Noresourcefoundthatmatchesthegivenname(at'id'withvalue'@id/question_text_view').error:Error:Noresourcefoundthatmatchesthegivenname(at'id'withvalue'@id/next_button').这是布局文件这是我的strings.xmlGeoQuizTrueFalseCorrectNextIncorrectSettingsFrankReedHortonFoundedAPOondecemb

java - MissingResourceException : Can't find bundle for base name sun. util.logging.resources.logging,语言环境 en_US

我得到了,Causedbyjava.lang.InternalError:java.util.MissingResourceException:Can'tfindbundleforbasenamesun.util.logging.resources.logging,localeen_US在我的来自firebase崩溃报告的应用程序中。其他细节Manufacturer:HTCModel:HTC10AndroidAPI:24这是堆栈跟踪java.util.logging.Logger$1.run(Logger.java:1385)java.util.logging.Logger$1.run

安卓异常 "The specified child already has a parent..."

我收到如下异常。谁能帮帮我?06-1611:32:48.237:ERROR/AndroidRuntime(9223):java.lang.IllegalStateException:Thespecifiedchildalreadyhasaparent.YoumustcallremoveView()onthechild'sparentfirst.06-1611:32:48.237:ERROR/AndroidRuntime(9223):atandroid.view.ViewGroup.addViewInner(ViewGroup.java:1970)06-1611:32:48.237:ER

java - ScrollView:将触摸事件传递给 child

我用ImageView制作了一个“操纵杆”。它位于ScrollView中。它可以在没有ScrollView的情况下工作,但在ScrollView内部它不会接收垂直移动的TouchEvents。如何阻止ScrollView阻止触摸事件? 最佳答案 我找到了解决方案here.我创建了一个自定义的ScrollView类,它有一个boolean值指示它是否被锁定。onInterceptTouchEvent方法被覆盖:@OverridepublicbooleanonInterceptTouchEvent(MotionEventev){if(!

android - res-auto 和 com.package.name 之间命名 xml 的区别 - android

我见过自定义xml:和这两个不同的名字有什么区别?后者是否仅指向默认位置,如您的包裹?前者是否指向引用库?谢谢。 最佳答案 如果我们在项目中添加一个新的自定义View及其属性,您可以在布局的开头添加它:xmlns:custom="http://schemas.android.com/apk/res/your_main_app_package如果新的自定义View在链接到您的项目的库项目中,则添加:xmlns:custom="http://schemas.android.com/apk/res-auto注意:此问题已在ADT修订版17

android - 为 child 定义自定义 ViewGroup 属性

我正在寻找一种方法来为他们的child使用的View定义自定义属性。例如layout_centerInParent用于RelativeLayouts的子级或layout_span用于TableLayouts的子级。 最佳答案 以防万一其他人像我一样来到这里希望得到一个方向:在子级中定义的布局参数在父级中使用。例如,layout_centerInParent被RelativeLayout父级用来根据其此属性的值定位子级。在自定义ViewGroup中,您可以创建一个扩展ViewGroup.LayoutParams的内部类。然后您可以在子