小编Pro*_*000的帖子

使用Bootstrap 3如何隐藏表格中的列?

我试图隐藏列我响应式设计的时候col-xscol-sm.我首先尝试使用hidden-xs/hidden-sm类,但这不起作用.我也尝试使用visible-desktop这里提到的:Twitter Bootstrap Responsive - 仅在桌面上显示表列

这也行不通.做这个的最好方式是什么?我宁愿不做两个单独的表然后隐藏一个或另一个.

我试过的代码当前没有用:

<table>
    <thead>
        <th>Show All the time</th>
        <th class="hidden-xs hidden-sm">Hide in XS and SM</th>
    </thead>
    <tbody>
        <tr>
            <td>Show All the time</td>
            <td class="hidden-xs hidden-sm">Hide in XS and SM</td>
        </tr>
    </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

html css html-table responsive-design twitter-bootstrap

28
推荐指数
2
解决办法
9万
查看次数

嵌套构造函数C ++

我正在使用SFML,并且具有类似以下的类:

#include <SFML\Graphics.hpp>

class Overlay
{
public:
    Overlay(int width, int height);
    Overlay(const sf::Texture*);
    Overlay(const sf::Sprite*);

    ~Overlay();

private:
    sf::Texture _texture;
    sf::Image _img;
};
Run Code Online (Sandbox Code Playgroud)

现在,以下构造函数Overlay(const sf::Sprite*)正在运行:

Overlay::Overlay(const sf::Sprite* spr) {    
    int width = spr->getTexture()->getSize().x;
    int height = spr->getTexture()->getSize().y;
    _texture.create(width, height);
    _img.create(width, height, sf::Color::Transparent);
}
Run Code Online (Sandbox Code Playgroud)

但是,以下嵌套的构造函数不是:

Overlay::Overlay(int width, int height)
{
    _texture.create(width, height);
    _img.create(width, height, sf::Color::Transparent);
}

Overlay::Overlay(const sf::Texture* tex) {
    sf::Vector2u textureSize = tex->getSize();
    Overlay(textureSize.x, textureSize.y);
}

Overlay::Overlay(const sf::Sprite* spr) {
    Overlay(spr->getTexture());
}
Run Code Online (Sandbox Code Playgroud)

在我看来,如果执行以下命令,这两个代码片段应该做同样的事情:

sf::Sprite image;
Overlay mOverlay(&image);
Run Code Online (Sandbox Code Playgroud)

尽管它们都可以很好地编译,但是当调用第二个代码片段(嵌套构造函数)_img …

c++ constructor nested sfml

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

获取数组的属性作为新数组C#

假设我有一个类似以下的类:

class Book
{
    public int id;
    public string title;
}
Run Code Online (Sandbox Code Playgroud)

在某个地方之后我有一个数组Book[] books,现在要一个标题数组string[] titles = {books[0].title, books[1].title, ..., books[n].title}。有没有比遍历books数组更简单的方法?就像是

string[] titles = books.getProperty(title)
Run Code Online (Sandbox Code Playgroud)

提前致谢

c# arrays sub-array

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