草庐IT

android - Listview 不会匹配_parent

这是XML:ListView只占线性布局剩余高度的四分之一左右。作为一种体验,我尝试单独使用它(删除textview和线性布局)并且它按预期拉伸(stretch)。可能很笨但是想不通... 最佳答案 在listview中添加项目,默认增加和滚动,并使其成为wrap_content。您的具体问题是什么?问题不是很清楚。 关于android-Listview不会匹配_parent,我们在StackOverflow上找到一个类似的问题: https://stacko

Android 1 Parent ScrollView, 3 TextView 垂直滚动

我对android编程有疑问。我有一个用于整个Activity的父ScrollView,并且有三个具有滚动功能的TextView。但是,当我使用以下代码时,它似乎根本不起作用。只有父级滚动可用。finalViewview=inflater.inflate(R.layout.activity_register_terms_fragment,container,false);TextViewbasicTermView=(TextView)view.findViewById(R.id.register_terms_basic_info);TextViewpurposeTermView=(Te

android - 由 fill_parent TextView 重叠的圆角线性布局角

这是我需要放在布局顶部的内容这就是我实际拥有的会有一个简单的选项,我目前没有计算。可绘制圆角布局...我已经尝试将可绘制对象移动到第一个LinearLayout子项。如何防止TextView隐藏圆角? 最佳答案 在Manishika的帮助下(我投票赞成你的答案[为我做同样的事情!:)])我发布了我的问题的解决方案!使用这个父圆角样式:我们需要将特定的可绘制对象附加到TextView(或您需要的任何View)。这是该技巧的可绘制对象:我减去2d记住!!图形布局(预览)将不显示正确的舍入!您需要在设备(如果没有设备,则为模拟器)上对其进

android - LinearLayout 或其 LinearLayout parent 没用,我可以忽略警告消息吗?

我遇到嵌套布局问题并抛出一些异常。错误是“此LinearLayout布局或其LinearLayout父级无用......”。我知道我可以通过此设置忽略此警告。设置:BuildPath->ConfigureBuildPath....在AndroidLintPreferences下查找UselessParent并将其严重性设置为忽略或单击IgnoreAll。但是,Eclipse图形布局无法显示任何内容并显示错误消息-“索引:0,大小0,异常详细信息记录在窗口>显示View>错误日志中”。如何使图形布局显示嵌套布局?这是我的代码:谢谢大家。 最佳答案

android - 在 Android 中获取 subview 以 match_parent

我有一个简单的线性布局,我正在适配器中对其进行膨胀:@OverridepublicViewgetView(finalintposition,ViewconvertView,finalViewGroupparent){if(convertView==null){convertView=inflater.inflate(R.layout.category_listview_row,parent,false);}else{((LinearLayout)convertView).removeAllViews();}if(LAYOUT_TYPES.GRID.equals(layoutType))

android - 自定义对话框中的 ImageView - fill_parent 不起作用,我的对话框很小

我有一个简单的要求:我必须在对话框中放一些图片(一些小分辨率,一些大分辨率)并全屏显示。我试过这个:Dialogdialog=newDialog(getActivity());dialog.setContentView(R.layout.custom_dialog);intpicId=Integer.valueOf(webcamCursor.getString(webcamCursor.getColumnIndex("_id")));dialog.setTitle(webcamCursor.getString(webcamCursor.getColumnIndex("City")));

android - 非法状态异常 : Could not find method insert(View) in a parent or ancestor Context class android. support.v7.widget.AppCompatButton

我已经在单个项目中启动了该程序,该程序运行正常。但是,当我复制并粘贴到一个更大的项目中时,它会在logcat中出现以下错误。FATALEXCEPTION:mainProcess:com.example.alan.mainactivity,PID:11545java.lang.IllegalStateException:Couldnotfindmethodinsert(View)inaparentorancestorContextforandroid:onClickattributedefinedonviewclassandroid.support.v7.widget.AppCompat

Android match_parent 未按预期工作

在我的布局文件中,我使用根ScrollView和子LinearLayout。我对此进行了搜索,但没有得到帮助。我在父View和subview中设置了ma​​tch_parent。但是subview有问题。subview不像父View那样填充。这是图片和xml代码。布局文件。 最佳答案 在ScrollView中尝试android:fillViewport="true"。 关于Androidmatch_parent未按预期工作,我们在StackOverflow上找到一个类似的问题:

android - 布局问题 : SliderDrawer doesn't fill parent width

我在Android中使用SliderDrawer。在抽屉里,我有一个布局,其中包含一个膨胀的布局。这是最终结果:请注意抽屉的内容(灰色)如何不占用父级(黑色区域)的整个宽度。这是抽屉代码(main_layout.xml):[更新2,添加了整个代码:]这里是充气区域的代码(media_player_container.xml):你能发现我做错了什么吗??[更新1]这是我膨胀布局的代码(在onCreate()内部):LinearLayoutcontainer=(LinearLayout)this.findViewById(R.id.media_player_container);Layou

android - 为什么我会收到 "Error Retrieving parent for item: No resource found that matches the given name ' @android :style/Theme. Dialog.Alert'”?

在我的项目属性中,我有Android2.2,团队中的另一个人能够很好地构建。我在res->values下的themes.xml文件中收到错误ErrorRetrievingparentforitem:Noresourcefoundthatmatchesthegivenname'@android:style/Theme.Dialog.Alert'.因此我无法构建我的项目。这是一个正确的项目,我从SVN存储库获取并导入到Eclipse中。@style/DA.TextView 最佳答案 我遇到了同样的问题。尝试增加list文件中的min-s