小编ank*_*h13的帖子

在android布局文件中评论

如何在android布局的xml文件中发表评论.我在Android Layout xml中看过评论 - 但我想在父母内部发表评论.

当我尝试这样做时,我在eclipse中遇到错误:

<Button android:text="Button" 
<!-- this is a comment -->
android:id="@+id/Discon" >
</Button>
Run Code Online (Sandbox Code Playgroud)

从xml的背景知识,我开始知道我们不能在属性中添加注释.有没有办法删除id作为属性并将其指定为元素?
或者有没有办法在元素属性中添加注释?

xml android android-layout

24
推荐指数
2
解决办法
3万
查看次数

在boost变量中使用相同的数据类型

我们可以明确地对可以存储在boost varaint中的值进行类型转换吗?

例:

typedef int abc;

typedef int asd;

typedef boost::variant<abc, char, asd, float> link_try1;

int main()
{

  link_try1 qw;
  qw = static_cast<asd>(1234);
  printf("value of which is:%d", qw.which());
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

在这里,我希望which()函数重新启动3但它总是重新生成0.有没有办法直接更改其中的值_(类变量中的私有变量)或显式指定要使用的数据类型?

关心Ankith

c++ boost boost-variant

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

标签 统计

android ×1

android-layout ×1

boost ×1

boost-variant ×1

c++ ×1

xml ×1