我的代码
// Setup prox to handle blog requests
httpProxy.createServer({
hostnameOnly: true,
router: {
'http://localhost': '8080',
'http://localhost/blog': '2368'
}
}).listen(8000);
以前我用过这个:
http.createServer(app).listen(app.get('port'), function(){
console.log("Express server listening on port " + app.get('port'));
});
基本上,我还是想用express...但是,当人们去http://localhost/blog
,但仍被送达port 8080
(最终将是80端口)
所以我换了这个,效果更好了。问题是express接管了路由(据我所知)。
var options = {
// pathnameOnly: true,
router: {
'localhost': 'localhost:8080',
'localhost/blog': 'localhost:2368'
}
}
// Setup prox to handle blog requests
var proxyServer = httpProxy.createServer(options);
proxyServer.listen(9000);
require('./app/server/router')(app);
http.createServer(app).listen(app.get('port'), function(){
console.log("Express server listening on port " + app.get('port'));
});
在ScrollView这不起作用,因为这RelativeLayout将重叠ScrollView在页面底部的任何东西。
我使用动态拉伸来修复它FrameLayout:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fillViewport="true">
<LinearLayout
android:id="@+id/LinearLayout01"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<!-- content goes here -->
<!-- stretching frame layout, using layout_weight -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</FrameLayout>
<!-- content fixated to the bottom of the screen -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- your bottom content -->
</LinearLayout>
</LinearLayout>
</ScrollView>
你应该尝试一个相对的布局。
如果你有一个相对的布局来填充整个屏幕,你应该可以用它android:layout_alignParentBottom来将按钮移动到屏幕的底部。
如果底部的视图没有以相对布局显示,那么上面的布局可能会占用所有的空间。在这种情况下,您可以将视图放置在底部,首先放置在布局文件中,然后将布局的其余部分放在视图的上方android:layout_above。这使得底部视图可以占用尽可能多的空间,其余的布局可以填充屏幕的其余部分。