小编Cod*_*tor的帖子

按钮不在LinearLayout中显示

我试图Button在a LinearLayout之后添加一个,TextView但它没有出现.

这是我的布局代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LinearLayout01"
    android:layout_width="fill_parent"
    android:layout_height="45dip">

    <TextView android:layout_width="fill_parent"
        android:layout_height="45dip"
        android:paddingLeft="5dip"
        android:paddingRight="5dip"
        android:textStyle="bold"
        android:textSize="17dip"
        android:gravity="center_vertical"
        android:id="@+id/tvChild"
        android:text="Children"
        android:textColor="#ffCCCC22" />

    <Button android:id="@+id/submit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:text="Submit" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

在TextView用正确的文本显示正常,但代替Button我收到三到四个线长度的一大空白.

我错过了什么?

android button android-layout

8
推荐指数
2
解决办法
1万
查看次数

使整个网页链接无法点击的最佳方法是什么

可能重复:
覆盖Javascript中链接('a')对象的默认行为

使主页中的整个页面链接只读的最佳方法是什么(不可点击href=#或href="javascript:void()"基于用户操作.

我只想使用Javascript和CSS来实现这一目标.

javascript css readonly hyperlink

4
推荐指数
2
解决办法
348
查看次数

如何从javascript异步函数访问返回值

我有一个Node.js函数从DB表中获取一些值

var GetPoints = function(ibmdb, dbConnection, msisdn) {
    ibmdb.open(dbConnection, function(err, conn) {
        if (err) {
            //Error
        } else {
            conn.query('SELECT id,msisdn,points FROM t_points WHERE msisdn =' + msisdn, function(err, data) {
                console.log(err);
                if (!err) {
                    conn.close(function(err) {
                        if (!err) {}
                    });
                    consele.log(data);
                    //return data[0].POINTS;
                } else {
                    //Error
                }
            });
        }
        console.log("points" + points);
    });
}
Run Code Online (Sandbox Code Playgroud)

我想知道data当我从外面调用这个函数时如何访问该对象

 var data = GetPoints(ibmdb, dbConnection, msisdn);
Run Code Online (Sandbox Code Playgroud)

当我这样做时,值正确 console.log

javascript asynchronous node.js

1
推荐指数
1
解决办法
457
查看次数