我正在关注帖子"Android设计库NavigationView with footer",在NavigationView底部添加按钮.问题是只出现最后一个NavigationView,它占据整个屏幕高度.
这是我的布局:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Activity here -->
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start">
<android.support.design.widget.NavigationView
android:id="@+id/navigation_menu_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="top"
app:menu="@menu/menu_drawer"/>
<android.support.design.widget.NavigationView
android:id="@+id/navigation_footer_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:menu="@menu/menu_drawer_footer"/>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)
结果如下:
我怎样才能解决这个问题?
如果你想帮我检查一下发生了什么,这里是Github的存储库:https://github.com/sandrocsimas/ngx-material-palette-picker
我正在尝试创建我的第一个角度库.我使用angular cli命令生成代码:
ng new ngx-material-palette-picker-app
ng generate library ngx-material-palette-picker
Run Code Online (Sandbox Code Playgroud)
在NgxMaterialPalettePickerComponent我正在导入json文件的组件中,但构建引发了以下错误:
projects/ngx-material-palette-picker/src/lib/ngx-material-palette-picker.component.ts(2,31): error TS2307: Cannot find module './palettes.json'.
Run Code Online (Sandbox Code Playgroud)
这是我的组成部分:
import {Component, OnInit} from '@angular/core';
import * as palettesJSON from './palettes.json';
@Component({
selector: 'ngx-mpp',
template: `,
styles: []
})
export class NgxMaterialPalettePickerComponent implements OnInit {
constructor() {
}
}
Run Code Online (Sandbox Code Playgroud)
我创建了一个types在根路径中调用的目录,并将以下代码添加到index.d.ts:
declare module '*.json' {
const value: any;
export default value;
}
Run Code Online (Sandbox Code Playgroud)
我还添加了目录types到typeRoots主tsconfig.json.
"typeRoots": [
"node_modules/@types",
"types"
],
Run Code Online (Sandbox Code Playgroud)
该项目在Sublime编辑器中没有显示任何错误,但是当我尝试使用该命令构建项目时,ng build …
我正在尝试在iframe中渲染我的React组件。我通过使用库“ react-frame-component”来使其工作。问题在于样式是在“ head”元素末尾的iframe外部加载的。我想更改它以将其加载到“ iframe”元素的“ head”中。我正在使用Webpack生成包含JS和CSS的捆绑软件,并且看到可以通过设置选项“ insertInto”来更改“ style-loader”加载样式的位置,但这会引发错误:
Uncaught Error: Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.
Run Code Online (Sandbox Code Playgroud)
这是我的React组件:
import Frame from 'react-frame-component'
...
ReactDOM.render(
<Frame id="someId">
<Provider store={Store.get()}>
<Container/>
</Provider>,
</Frame>,
document.body
);
Run Code Online (Sandbox Code Playgroud)
这是我在Webpack配置中的“样式加载器”:
{
loader: 'css-loader',
options: {
insertInto: () => document.querySelector("#someId"),
},
}
Run Code Online (Sandbox Code Playgroud)
我认为问题在于,当webpack尝试包含样式时,该组件未呈现。如何解决呢?
使用 XML 配置就像
<custom-filter position="FORM_LOGIN_FILTER" ref="SCAAuthenticationFilter" />.
Run Code Online (Sandbox Code Playgroud)
没有 XML 会像:
httpSecurity.addFilter(new SCAAthenticationFilter())
Run Code Online (Sandbox Code Playgroud)
似乎 spring 没有替换UsernamePasswordAuthenticationFilter,但之前添加了我的过滤器。
我想在每个测试方法之前执行两个脚本,但是我也想定义一些要在特定方法之前执行的脚本。使用Spring框架和@Sql注释,可以吗?
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/WEB-INF/application-context.xml")
@DirtiesContext(classMode = ClassMode.BEFORE_EACH_TEST_METHOD)
@Sql({ "/database/drop_schema.sql", "/database/create_schema.sql" })
public class CentralServiceTestCase {
// I want to run "drop_schema.sql", "create_schema.sql"
// and "basic_data.sql" here
@Test
@Sql({ "/database/basic_data.sql" })
public void processActionWithSuccess() {
}
// I want to run only "drop_schema.sql" and "create_schema.sql" here
@Test
public void anotherTestMethod() {
}
}
Run Code Online (Sandbox Code Playgroud)
运行此代码仅执行“ basic_data.sql”。如何解决这个问题呢?我将不得不从类中删除@Sql注释,并为每个定义了“ /database/drop_schema.sql”和“ /database/create_schema.sql”的方法复制它?
当我尝试使用ng-paste指令获取粘贴的数据时,我遇到了问题.
<input ng-model="evidence.url" ng-paste="getEvidenceInfos(evidence, $event.clipboardData.getData('text/plain'))">
Run Code Online (Sandbox Code Playgroud)
当jquery在角度后加载时,它工作正常.
在角度之前加载jquery时怎么做?
<input ng-model="evidence.url" ng-paste="getEvidenceInfos(evidence, $event)">
$scope.getEvidenceInfos = function(evidence, event) {
$(event.currentTarget).val() // doesn't work
$(event.target).val() // doesn't work
}
Run Code Online (Sandbox Code Playgroud) 考虑到这个例子:
app.get('/url/:param', function(req, res, next) {
var param = req.params.param;
method1(param, function(err, model) {
if(err) return next(err);
method2(model, function(err, models) {
if(err) return next(err);
if(models.length > 0) {
method3(mode, models, function(err, models2) {
res.render("index.html", {model: model, models: models, models2: models2});
});
} else {
res.render("index.html", {model: model, models: models});
}
});
});
}
Run Code Online (Sandbox Code Playgroud)
有没有办法使用promises简化这个例子?看看所有方法都是dependents并且有类似的验证.if(models.length > 0)
此外,我需要res.render在一个独特的地方进行分组.
spring ×2
android ×1
angular ×1
angular-cli ×1
angularjs ×1
bluebird ×1
callback ×1
drawerlayout ×1
express ×1
iframe ×1
java ×1
javascript ×1
jquery ×1
promise ×1
reactjs ×1
spring-test ×1
webpack ×1