- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
当使用它的拆分条(组件的顶部边缘)调整此组件的大小时,这条恼人的红线随机出现。
我确实弄清楚了如何通过删除它的 CSS 类来永久删除红线,但是有一个问题 22。我很难删除此 Activity1 组件的 Sencha ExtJS 框架中的 CSS 类。我有一个样式问题,其中 backgroundColor 样式属性针对该组件内非常具体的容器布局显示一条红线。红色实际上来自名为“.x-border-layout-ct”的类。由于这三个组件的 backgroundColor 是“#F1F1F1”(白色),并且由于这三个组件位于 Activity1 之上,因此它应该覆盖 Activity1 backgroundColor。事实上,它确实如此,但只有当我将 Activity1 面板(在视口(viewport)中)调整为特定大小时。
我能够通过使用“this.removeCls('.x-border-layout-ct')”删除此类来纠正问题,但是如果我应用“this.callParent(arguments)”,它不会工作。在这种情况下,CSS 类会返回。避免使用“this.callParent(arguments)”是不好的,因为这样面板标题就不会被渲染。
Ext.define('App.view.module1.Activity1', {
extend: 'Ext.form.Panel',
xtype: 'view-module1-activity1',
title: 'test',
layout: {
type: 'border'
},
items: [{
id: 'top_component',
region: 'north',
xtype: 'component',
html: 'top panel',
style: {
backgroundColor: '#F1F1F1'
}
}, {
id: 'middle_component',
region: 'center',
xtype: 'component',
html: '<i>Middle Component</i>',
height: 50,
style: {
backgroundColor: '#F1F1F1',
color: '#b70101',
textAlign: 'center',
fontSize: 'large'
}
}, {
id: 'bottom_component',
region: 'south',
xtype: 'component',
html: 'bottom panel',
style: {
backgroundColor: '#F1F1F1'
}
}],
beforeRender: function() {
this.removeCls('.x-border-layout-ct'); // hack to remove red line between top_component and middle_component
this.callParent(arguments);
},
listeners: {
resize: function(view, width, height, oldWidth, oldHeight, eOpts) {
Ext.getCmp('top_component').setHeight((height-50)/2);
Ext.getCmp('bottom_component').setHeight((height-50)/2);
}
}
});
在呈现的 HTML 中,您可以看到设置此 CSS 类的位置。查看第二个“div”标签,在“div”标签的第二层。
<div class="x-panel x-border-item x-box-item x-panel-default" style="height: 298px; right: auto; left: 0px; top: 303px; margin: 0px; width: 803px;" id="view-module1-activity1-1046">
<div class="x-panel-header x-header x-header-horizontal x-docked x-unselectable x-panel-header-default x-horizontal x-panel-header-horizontal x-panel-header-default-horizontal x-top x-panel-header-top x-panel-header-default-top x-docked-top x-panel-header-docked-top x-panel-header-default-docked-top" id="view-module1-activity1-1046_header" style="right: auto; left: 0px; top: 0px; width: 803px;">
<div id="view-module1-activity1-1046_header-body" class="x-header-body x-panel-header-body x-panel-header-body-default x-panel-header-body-horizontal x-panel-header-body-default-horizontal x-panel-header-body-top x-panel-header-body-default-top x-panel-header-body-docked-top x-panel-header-body-default-docked-top x-box-layout-ct x-panel-header-body-default-horizontal x-panel-header-body-default-top x-panel-header-body-default-docked-top" style="width: 791px;">
<div id="view-module1-activity1-1046_header-innerCt" class="x-box-inner " role="presentation" style="width: 791px; height: 16px;">
<div id="view-module1-activity1-1046_header-targetEl" class="x-box-target" style="width: 791px;">
<div class="x-component x-header-text-container x-panel-header-text-container x-panel-header-text-container-default x-box-item x-component-default" unselectable="on" id="view-module1-activity1-1046_header_hd" style="right: auto; left: 0px; top: 0px; margin: 0px; width: 791px;"><span id="view-module1-activity1-1046_header_hd-textEl" class="x-header-text x-panel-header-text x-panel-header-text-default" unselectable="on">test</span>
</div>
</div>
</div>
</div>
</div>
<div id="view-module1-activity1-1046-body" class="x-panel-body x-panel-body-default x-border-layout-ct x-panel-body-default" style="width: 803px; height: 273px; left: 0px; top: 25px;">
<div class="x-panel x-autowidth-table x-grid-no-row-lines x-grid-header-hidden x-border-item x-box-item x-panel-default x-tree-panel x-tree-lines x-grid" id="top_component" style="right: auto; left: 0px; top: 0px; margin: 0px; width: 801px; height: 124px;">
<div class="x-grid-header-ct x-grid-header-ct-hidden x-docked x-grid-header-ct-default x-docked-top x-grid-header-ct-docked-top x-grid-header-ct-default-docked-top x-box-layout-ct" style="border-width: 1px; height: 0px; right: auto; left: 0px; top: 0px; width: 801px;" id="headercontainer-1047">
<div id="headercontainer-1047-innerCt" class="x-box-inner " role="presentation" style="width: 10017px; height: 0px;">
<div id="headercontainer-1047-targetEl" class="x-box-target" style="width: 10017px;">
<div class="x-column-header x-column-header-align-left x-box-item x-column-header-default x-unselectable x-column-header-first x-column-header-last" style="border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; width: 10000px; right: auto; left: 0px; top: 0px; margin: 0px; height: 0px;" id="treecolumn-1048">
<div id="treecolumn-1048-titleEl" class="x-column-header-inner"><span id="treecolumn-1048-textEl" class="x-column-header-text">Name</span>
<div id="treecolumn-1048-triggerEl" class="x-column-header-trigger"></div>
</div>
</div>
</div>
</div>
</div>
<div id="top_component-body" class="x-panel-body x-grid-body x-panel-body-default x-layout-fit x-panel-body-default" style="width: 801px; height: 124px; left: 0px; top: 0px;">
<div class="x-tree-view x-fit-item x-tree-view-default x-unselectable" id="treeview-1049" tabindex="-1" style="overflow: auto; margin: 0px; width: 799px; height: 122px;">
<table role="presentation" id="treeview-1049-table" class="x-treeview-1049-table x-grid-table" border="0" cellspacing="0" cellpadding="0" style="width: 10000px;" tabindex="-1">
<colgroup>
<col class="x-grid-cell-treecolumn-1048" style="width: 10000px;">
</colgroup>
<tbody id="treeview-1049-body"></tbody>
</table>
</div>
</div>
</div>
<div class="x-component x-border-item x-box-item x-component-default" style="color: rgb(183, 1, 1); text-align: center; font-size: large; height: 23px; right: auto; left: 0px; top: 124px; margin: 0px; width: 801px; background-color: rgb(241, 241, 241);" id="middle_component"><i>Middle Component</i>
</div>
<div class="x-panel x-autowidth-table x-grid-no-row-lines x-grid-header-hidden x-border-item x-box-item x-panel-default x-tree-panel x-tree-lines x-grid" id="bottom_component" style="right: auto; left: 0px; top: 147px; margin: 0px; width: 801px; height: 124px;">
<div class="x-grid-header-ct x-grid-header-ct-hidden x-docked x-grid-header-ct-default x-docked-top x-grid-header-ct-docked-top x-grid-header-ct-default-docked-top x-box-layout-ct" style="border-width: 1px; height: 0px; right: auto; left: 0px; top: 0px; width: 801px;" id="headercontainer-1050">
<div id="headercontainer-1050-innerCt" class="x-box-inner " role="presentation" style="width: 10017px; height: 0px;">
<div id="headercontainer-1050-targetEl" class="x-box-target" style="width: 10017px;">
<div class="x-column-header x-column-header-align-left x-box-item x-column-header-default x-unselectable x-column-header-first x-column-header-last" style="border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; width: 10000px; right: auto; left: 0px; top: 0px; margin: 0px; height: 0px;" id="treecolumn-1051">
<div id="treecolumn-1051-titleEl" class="x-column-header-inner"><span id="treecolumn-1051-textEl" class="x-column-header-text">Name</span>
<div id="treecolumn-1051-triggerEl" class="x-column-header-trigger"></div>
</div>
</div>
</div>
</div>
</div>
<div id="bottom_component-body" class="x-panel-body x-grid-body x-panel-body-default x-layout-fit x-panel-body-default" style="width: 801px; left: 0px; top: 0px; height: 124px;">
<div class="x-tree-view x-fit-item x-tree-view-default x-unselectable" id="treeview-1052" tabindex="-1" style="overflow: auto; margin: 0px; width: 799px; height: 122px;">
<table role="presentation" id="treeview-1052-table" class="x-treeview-1052-table x-grid-table" border="0" cellspacing="0" cellpadding="0" style="width: 10000px;" tabindex="-1">
<colgroup>
<col class="x-grid-cell-treecolumn-1051" style="width: 10000px;">
</colgroup>
<tbody id="treeview-1052-body"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
我找到了这个关于组件生命周期的演示文稿,但我无法弄清楚如果您有多个级别的容器,需要从什么事件中调用“removeCls”。再次注意,通过 itslef 全部使用“removeCls”(作为“beforeRender”事件中的唯一函数,该类消失,因此 Activity1 backgroundColor 中恼人的红线不可见。但是如果我有“this.callParent( arguments)”,它不会从 Activity1 中删除实际的 CSS 类。应该调用什么事件来删除 CSS 类?
http://www.slideshare.net/moduscreate/ext-js-40-components-and-layouts
组件生命周期:
1. Initialization - Bootstrap the Component (Create ID, register with ComponentMgr, etc.)
a. configuration object is applied
b. base events are added
i. before activate, beforeshow, show, render
c. ID is assigned or auto generated
d. plugins are constructed (think ptypes or aliases)
e. initComponent is executed
i. custom listeners are applied
ii. bubbleEvents are initialized
f. component is registered with ComponentManager
g. base mixin constructors are executed
i. observable's constructor is called
ii. state's constructor is called
h. plugins are initialized
i. component loader is initialized
j. if configured, component is rendered (renderTo, applyTo)
k. if configured, component is shown
2. Render - Paint the Component on screen, hook element based events, use layouts to organize components
a. beforerender event is fired
b. component's element is cached as the 'el' reference
c. if a floating component, floating is enabled and registered with WindowManager
d. the component's container element is initialized
e. onrender is executed
i. component's element is injected into the DOM
ii. scoped reset CSS is applied if configured to do so
iii. base CSS classes and styles are applied
iv. 'ui' is applied
v. 'frame' initialized
vi. renderTpl is initialized
vii. renderData is initialized
viii. renderTpl is applied to component's element using renderData
ix. Render selectors are applied
x. 'ui' styles are applied
f. element's visibility mode is set via the hideMode attribute
g. if overCls is set, mouseover/out events are hooked
h. render event is fired
i. component's contents is initialized (html, contentEl, tpl/data)
j. afterRender is executed
i. container layout is initialized (AbstractContainer)
ii. ComponentLayout is initialized (AbstractComponent)
iii. Component's size is set
iv. if floating, component is moved in the XY Coordinate space
k. afterrender event is fired
l. afterRender events are hooked into the cmp's Elements
m. Component is hidden if configured
n. component is disabled if configured
3. Destruction - wipe the Component from the screen, purge event listeners
a. beforedestroy event is fired
b. if floating, the component is deregistered from floating manager
c. component is removed from its parent container
d. element is removed from the DOM
i. element listeners are purged
e. onDestroy is called
f. plugins are destroyed
g. component is deregistered from ComponentManager
h. destroy event is fired
i. state mixin is destroyed
j. component listeners are purged
最佳答案
我通过做一些不同的事情来修复它。问题来自中间组件的边缘。当我将上边距应用为中间组件的 -1px 时,红线永远不会出现。但有时边距太小一个像素,具体取决于我移动了多少。但有时我宁愿将其顶部缩小 1px,也不愿有时使用红线。
}, {
id: 'middle_component',
region: 'center',
xtype: 'component',
html: '<i>Middle Component</i>',
height: 50,
style: {
backgroundColor: '#F1F1F1',
color: '#b70101',
textAlign: 'center',
fontSize: 'large',
margin: '-1px 0px 0px 0px' // added this line!
}
}, {
关于css - 在 Sencha ExtJS 框架中应该删除什么 CSS 类的组件事件? (烦人的红线),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26556891/
我正在尝试在Elasticsearch中返回的值中考虑地理位置的接近性。我希望近距离比某些字段(例如legal_name)重要,但比其他字段重要。 从文档看来,当前的方法是使用distance_fea
我是Elasticsearch的初学者,今天在进行“多与或”查询时遇到问题。 我有一个SQL查询,需要在Elastic中进行转换: WHERE host_id = 999 AND psh_pid =
智能指针应该/可以在函数中通过引用传递吗? 即: void foo(const std::weak_ptr& x) 最佳答案 当然你可以通过const&传递一个智能指针。 这样做也是有原因的: 如果接
我想执行与以下MYSQL查询等效的查询 SELECT http_user, http_req_method, dst dst_port count(*) as total FROM my_table
我用这两个查询进行测试 用must查询 { "size": 200, "from": 0, "query": { "bool": { "must": [ { "mat
我仍在研究 Pro Android 2 的简短服务示例(第 304 页)同样,服务示例由两个类组成:如下所示的 BackgroundService.java 和如下所示的 MainActivity.j
给定标记 like this : header really_wide_table..........................................
根据 shouldJS 上的文档网站我应该能够做到这一点: ''.should.be.empty(); ChaiJS网站没有使用 should 语法的示例,但它列出了 expect 并且上面的示例似乎
我在 Stack Overflow 上读到一些 C 函数是“过时的”或“应该避免”。你能给我一些这种功能的例子以及原因吗? 这些功能有哪些替代方案? 我们可以安全地使用它们 - 有什么好的做法吗? 最
在 C++11 中,可变参数模板允许使用任意数量的参数和省略号运算符 ... 调用函数。允许该可变参数函数对每个参数做一些事情,即使每个参数的事情不是一样的: template void dummy(
我在我从事的项目之一上将Shoulda与Test::Unit结合使用。我遇到的问题是我最近更改了此设置: class MyModel :update end 以前,我的(通过)测试看起来像这样: c
我该如何做 or使用 chai.should 进行测试? 例如就像是 total.should.equal(4).or.equal(5) 或者 total.should.equal.any(4,5)
如果您要将存储库 B 中的更改 merge 到存储库 A 中,是否应该 merge .hgtags 中的更改? 存储库 B 可能具有 A 中没有的标签 1.01、1.02、1.03。为什么要将这些 m
我正在尝试执行X AND(y OR z)的查询 我需要获得该代理为上市代理或卖方的所有已售属性(property)。 我只用 bool(boolean) 值就可以得到9324个结果。当我添加 bool
我要离开 this教程,尝试使用 Mocha、Supertest 和 Should.js 进行测试。 我有以下基本测试来通过 PUT 创建用户接受 header 中数据的端点。 describe('U
我正在尝试为 Web 应用程序编写一些 UI 测试,但有一些复杂的问题希望您能帮助我解决。 首先,该应用程序有两种模式。其中一种模式是“训练”,另一种是“现场”。在实时模式下,数据直接从我们的数据库中
我有一个规范: require 'spec_helper' # hmm... I need to include it here because if I include it inside desc
我正在尝试用这个测试我在 Rails 中的更新操作: context "on PUT to :update" do setup do @countdown = Factory(:count
我还没有找到合适的答案: onclick="..." 中是否应该转义 &(& 符号)? (或者就此而言,在每个 HTML 属性中?) 我已经尝试在 jsFiddle 和 W3C 的验证器上运行转义和非
import java.applet.*; import java.awt.*; import java.awt.event.*; public class Main extends Applet i
我是一名优秀的程序员,十分优秀!