layout 相关问题

布局标记用于关于对象相对于包含元素的放置,对齐和对齐的问题。有关CSS的问题,请改用“css”标签。







在qml中,如何为布局的每个孩子设置属性?

的自定义组件,它基本上是一个带有文本的圆形矩形。 我想把这样的列中的5个元素中的5个元素:

回答 1 投票 0


什么是“ android.r.layout.simple_list_item_1”?

我已经开始学习Android开发,并遵循一本书中的招待示例: // Create the array list of to do items final ArrayList<String> todoItems = new ArrayList<String>(); // Create the array adapter to bind the array to the listView final ArrayAdapter<String> aa; aa = new ArrayAdapter<String>( this, android.R.layout.simple_list_item_1, todoItems ); myListView.setAdapter(aa); 我无法完全理解此代码,尤其是此行: android.R.layout.simple_list_item_1 Zakaria,这是对Android OS一部分的内置XML布局文档的参考,而不是您自己的XML布局之一。 there是您可以使用的另一个布局列表: http://developer.android.com/reference/android/r.layout.html (更新链接谢谢@estel:Https://github.com/android/platform_frameworks_base/tree/master/master/core/core/res/res/res/layout) 您实际上可以查看布局的代码。 这是Android OS的一部分。这是已定义的XML文件的实际版本。 SIMPLE_LIST_ITEM_1: <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" style="?android:attr/listItemFirstLineStyle" android:paddingTop="2dip" android:paddingBottom="3dip" android:layout_width="fill_parent" android:layout_height="wrap_content" /> SIMPLE_LIST_ITEM_2: <TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android" android:paddingTop="2dip" android:paddingBottom="2dip" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@android:id/text1" android:layout_width="fill_parent" android:layout_height="wrap_content" style="?android:attr/listItemFirstLineStyle"/> <TextView android:id="@android:id/text2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@android:id/text1" style="?android:attr/listItemSecondLineStyle" /> </TwoLineListItem> 以上回答:Kcoppock和Joril go在这里:https://github.com/android/platform_frameworks_base/tree/master/master/core/core/res/res/res/layout 右键单击您想要的布局文件,然后选择“保存为”,保存在某处,然后在Android Project(Eclipse)中的“布局”文件夹中复制它... 您可以看到布局的外观:) 走了... klap“ android.r.layout.simple_list_item_1是对android OS一部分的内置XML布局文档” 所有布局都位于:SDK \ Platforms Ndroid-XX \ Data中 es \layout 查看布局的XML: eclipse:简单地键入Android.r.layout.simple_list_item_1在代码中的某个地方,握住Ctrl,悬停在Simple_List_Item_1上,然后从下拉列表中选择“在Layout/Simple_list_item_item_1.xml中选择“打开声明”。它会将您引向XML的内容。 AndroidStudio:项目窗口 - >外部库 - > Android X Platform-> Res->布局,在这里您将看到可用布局的列表。 android.R.layout.simple_list_item_1,这是您的Res/Res/Layout文件夹中的行布局文件,其中包含listview中行的相应设计。现在,我们只使用mylistview.setadapter(aa);将数组列表项绑定到行布局中 无需转到外部链接,您需要的所有内容都位于计算机上: android ndroid-sdk \ platforms ndroid-x \ data es \layout. 这里都位于所有Android布局的代码代码。 per arvand: eclipse:只需键入android.r.layout.simple_list_item_1在代码中某个地方,握住ctrl,悬停在SIMPLE_LIST_ITEM_1上,然后从出现的下拉中选择“ layout/simple_list_list_item_item_item_1.xml”中的“选择”下拉。它会将您引向XML的内容。 从那里开始,如果然后将悬停在编辑器中的simple_list_item_1.xml选项卡中,您会看到该文件位于C:\ data Pplications \ android ndroid-ndroid-sdk \ android ndroid-sdk \ pl而且来数据 es \ layout \simple_list_item_1.xml(或安装的等效位置)。 我知道这个问题已经回答。 在搜索这个布局时,我想看看这种布局和其他外观,因此我决定提供您质疑的布局和其他人的外观。 基于@kevin Coppock的答案,我选择了一些列表项目布局。 所有这些布局都在Android的标准集中: 1。 simple_list_item_1 2。 simple_list_item_2 3。 activity_list_item 4。 simple_expandable_list_item_1 5。 simple_expandable_list_item_2 6。 simple_list_item_single_choice 7。 simple_list_item_multiple_choice 8。 simple_list_item_checked

回答 8 投票 0


回答 1 投票 0

如何在列之间添加一个差距,而无需移动到Bootstrap 5中的另一行? 我在一个具有这样的结构的证明部分上工作:

我在一个具有这样的结构的证明部分上工作: <div class="container"> <div class="row"> (row of the testimonial card) <div class="col"> (content/testimonial card) <div class="col"> (content/testimonial card) </div> </div> 有更多的行和列,每列内部(证词卡)的布局目的 问题是当我尝试在“推荐卡的“行”行上添加差距”时,证明卡将堆叠到1列中,而不是2(应该是什么),即使差距是最低 我尝试使用Row-Cols-2,但它不起作用 第二我试图通过添加:W-50&COL-6(和较低)来降低卡的尺寸,但仍然不起作用 最后一步是我尝试删除保存行和列(卡)的“容器”类,然后再一次不起作用 应该是什么样子: 结果: add在列之间,看看它是否有帮助。 <div class="container"> <div class="row row-cols-1 row-cols-md-2 g-4">(row of the testimonial card) <div class="col"> (content/testimonial card) </div> <div class="col"> (content/testimonial card) </div> </div> 检查文档:bootstrap水平牙龈

回答 1 投票 0


android kotlin应用程序工具栏未显示

我在Java版本中工作了,但是当我在Kotlin中重写它时,我显然缺少一些东西。我想使用工具栏而不是topapp栏。 我正在使用一个组合屏幕(与...相同

回答 1 投票 0

登录和注册的标准框架

当我将其放在屏幕上的其他位置时,默认位置就会在我单击按钮注册/登录的按钮后,将进入该位置。两者都处于边界布局。我已经阅读了某个地方,我需要将我的两个页面更改为单击按钮时切换的帧。这是一个合理的解决方案,还是质量较低?

回答 1 投票 0



如何创建特定的响应式网格布局,该布局具有独特的元素顺序? 我正在为我目前正在研究的网站制作仪表板,并且对网格布局有一些疑问,因为我主要只使用Flexbox。 如下图所示,我有3个标签...

.。 如下图所示,我有3个标签的标签,因此您可以看到我希望布局在分辨率变为移动设备时如何变化。 目前,我使用的是左侧的第一列(<div>的1和3)和右侧(<div>2),但是我无法创建我想要的移动布局。 但我看不到如何完成这项工作,因为<div>2在移动设备上时必须插入1和3之间,但在桌面视图中占用整个右侧。 树立的布局 我该怎么做? 这是我目前的设置,但我认为这对我想要的东西不起作用: (不包含详细的样式ATM如果我在这里得到一个很好的答案。)<div> i制定了一种解决方案,可以使用<div>和.dashboard-container { display: grid; grid-template-columns: 1fr 500px; column-gap: 1rem; padding: 1rem; } .dashboard-left { display: grid; grid-template-rows: 200px 1fr; row-gap: 1rem; } <div class="dashboard-container"> <div class="dashboard-left"> <div class="left-top"> <div class="dashboard-overview"> <p>overview</p> </div> </div> <div class="left-bottom"> <div class="dashboard-recent"> <p>recent</p> </div> <div class="dashboard-notes"> <p>notes</p> </div> </div> </div> <div class="dashboard-right"> <div class="dashboard-calendar"> <p>calendar</p> </div> </div> </div> (在此处查看更多)。 您的Maingrid-template将其定义为:属性: grid-area 您的第二仪表板,dashboard-container,将其定义为:grid-template要让它响应移动设备,您可以使用.dashboard-container { display: grid; grid-template: '. area2' '. area2'; } 查询(在此处查看更多)来更改dashboard-2:: .dashboard-2{ grid-area: area2; } Full代码示例(调整浏览器宽度以查看手机): @mediagrid-template

回答 1 投票 0

<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/image_Dead_Load" android:layout_centerHorizontal="true" android:layout_marginBottom="6dp" android:layout_marginLeft="6dp" android:layout_marginRight="6dp" android:background="@drawable/layout_border" android:paddingLeft="6dp" android:paddingRight="6dp"> <RelativeLayout android:id="@+id/material_info" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:background="@color/green"> <TextView android:id="@+id/wall_material" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_alignTop="@+id/material_thickness" android:layout_gravity="center_horizontal" android:layout_marginEnd="91dp" android:layout_marginRight="110dp" android:paddingLeft="5sp" android:text="جنس مصالح" android:textColor="@color/black" android:textSize="15sp" /> <TextView android:id="@+id/material_thickness" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginBottom="3dp" android:paddingLeft="5sp" android:text="ضخامت mm" android:textColor="@color/black" android:textSize="15sp" /> </RelativeLayout> <RelativeLayout android:id="@+id/brick_layout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/material_info" android:layout_marginTop="5dp"> <EditText android:id="@+id/editText_wall_width" android:layout_width="100dp" android:layout_height="30dp" android:layout_alignBottom="@+id/wall_material_spinner" android:layout_alignTop="@+id/wall_material_spinner" android:layout_marginRight="3dp" android:background="@drawable/textinputborder" android:inputType="numberDecimal" android:paddingLeft="5sp" android:textColor="@color/black" /> <Spinner android:id="@+id/wall_material_spinner" android:layout_width="wrap_content" android:layout_height="25dp" android:layout_toLeftOf="@+id/brick_material" android:layout_toRightOf="@+id/editText_wall_width" android:layout_toStartOf="@+id/brick_material" android:background="@drawable/spinner_background" android:spinnerMode="dropdown" /> <TextView android:id="@+id/brick_material" android:layout_width="60dp" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/wall_material_spinner" android:layout_alignParentRight="true" android:text="نوع آجر" android:textColor="@color/gray_heavy" android:textSize="15sp" /> </RelativeLayout> <RelativeLayout android:id="@+id/plastering_layout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/brick_layout"> <EditText android:id="@+id/editText_plastering_material" android:layout_width="100dp" android:layout_height="30dp" android:layout_alignBottom="@+id/plastering_material_spinner" android:layout_alignTop="@+id/plastering_material_spinner" android:layout_marginRight="3dp" android:background="@drawable/textinputborder" android:inputType="numberDecimal" android:paddingLeft="5sp" android:textColor="@color/black" /> <Spinner android:id="@+id/plastering_material_spinner" android:layout_width="wrap_content" android:layout_height="25dp" android:layout_marginTop="7dp" android:layout_toLeftOf="@+id/plastering_material" android:layout_toRightOf="@+id/editText_plastering_material" android:layout_toStartOf="@+id/plastering_material" android:background="@drawable/spinner_background" android:gravity="center_vertical" android:spinnerMode="dropdown" /> <TextView android:id="@+id/plastering_material" android:layout_width="60dp" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/plastering_material_spinner" android:layout_alignParentRight="true" android:text="نوع اندود" android:textColor="@color/gray_heavy" android:textSize="15sp" /> </RelativeLayout> <RelativeLayout android:id="@+id/esther_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/plastering_layout"> <TextView android:id="@+id/esther_material" android:layout_width="60dp" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/esther_material_spinner" android:layout_alignParentRight="true" android:text="نوع آستر" android:textColor="@color/gray_heavy" android:textSize="15sp" /> <Spinner android:id="@+id/esther_material_spinner" android:layout_width="wrap_content" android:layout_height="25dp" android:layout_marginTop="7dp" android:layout_toLeftOf="@+id/esther_material" android:layout_toRightOf="@+id/editText_esther_material" android:layout_toStartOf="@+id/esther_material" android:background="@drawable/spinner_background" android:gravity="center_vertical" android:spinnerMode="dropdown" /> <EditText android:id="@+id/editText_esther_material" android:layout_width="100dp" android:layout_height="30dp" android:layout_alignBottom="@+id/esther_material_spinner" android:layout_alignTop="@+id/esther_material_spinner" android:layout_marginRight="3dp" android:background="@drawable/textinputborder" android:inputType="numberDecimal" android:paddingLeft="5sp" android:textColor="@color/black" /> </RelativeLayout> <RelativeLayout android:id="@+id/exterior_mortar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/esther_layout"> <TextView android:id="@+id/exterior_mortar_material" android:layout_width="60dp" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/exterior_mortar_material_spinner" android:layout_alignParentRight="true" android:text="ملات بیرونی" android:textColor="@color/gray_heavy" android:textSize="12sp" /> <Spinner android:id="@+id/exterior_mortar_material_spinner" android:layout_width="wrap_content" android:layout_height="25dp" android:layout_marginTop="7dp" android:layout_toEndOf="@+id/editText_exterior_mortar_material" android:layout_toLeftOf="@+id/exterior_mortar_material" android:layout_toRightOf="@+id/editText_exterior_mortar_material" android:background="@drawable/spinner_background" android:gravity="center_vertical" android:spinnerMode="dropdown" /> <EditText android:id="@+id/editText_exterior_mortar_material" android:layout_width="100dp" android:layout_height="30dp" android:layout_alignBottom="@+id/exterior_mortar_material_spinner" android:layout_alignTop="@+id/exterior_mortar_material_spinner" android:layout_marginRight="3dp" android:background="@drawable/textinputborder" android:inputType="numberDecimal" android:paddingLeft="5sp" android:textColor="@color/black" /> </RelativeLayout> <RelativeLayout android:id="@+id/facing_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/exterior_mortar_layout"> <TextView android:id="@+id/facing_material" android:layout_width="60dp" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/facing_material_spinner" android:layout_alignParentRight="true" android:text="نوع نما" android:textColor="@color/gray_heavy" android:textSize="15sp" /> <Spinner android:id="@+id/facing_material_spinner" android:layout_width="wrap_content" android:layout_height="25dp" android:layout_marginTop="7dp" android:layout_toEndOf="@+id/editText_facing_material" android:layout_toLeftOf="@+id/facing_material" android:layout_toRightOf="@+id/editText_facing_material" android:background="@drawable/spinner_background" android:gravity="center_vertical" android:spinnerMode="dropdown" /> <EditText android:id="@+id/editText_facing_material" android:layout_width="100dp" android:layout_height="30dp" android:layout_alignBottom="@+id/facing_material_spinner" android:layout_alignTop="@+id/facing_material_spinner" android:layout_marginRight="3dp" android:background="@drawable/textinputborder" android:inputType="numberDecimal" android:paddingLeft="5sp" android:textColor="@color/black" /> </RelativeLayout> <Button android:id="@+id/wall_loading_btn" android:layout_width="150dp" android:layout_height="36dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_marginTop="5dp" android:background="@drawable/buttonshape" android:gravity="center" android:onClick="wallLoading" android:text="محاسبه" android:textColor="@color/white" android:textSize="18sp" android:textStyle="bold"></Button> </RelativeLayout> 秒,如您所见,我使用滑动选项卡,即Android Studio预览中未显示其高度: 我无法设置布局高度,而我的蓝色按钮在真实设备中的最后一个旋转器上。(请参阅第一张图片) 我该如何解决它们? 背景填充了整个“材料_info”布局,但是这种布局并不能填充整个宽度。如果您希望布局适合整个宽度,请删除顶级布局的桨板和边距,并为每个孩子单独设置它。 要实现可绘制自定义背景的圆角效果。您可以创建这样的自定义形状: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http//schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/yourGreen" /> <corners android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" android:topLeftRadius="@dimen/yourRadius" android:topRightRadius="@dimen/yourRadius" /> </shape> 调查第二个问题:您不会在预览中看到“选项卡在应用中可见

回答 1 投票 0


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.