Android问题:String types not allowed (at 'layout_gravity' with value 'top/right').

纠正Android布局重力属性
本文纠正了在Android布局文件中使用layout_gravity属性时的一个常见错误,并详细解释了该属性的正确用法及所有可选项。
android:layout_gravity="top/right"
出错的是这一句。
实际上应该是:
android:layout_gravity="top|right",这里的top和right的关系是并行的。
再说说layout_gravity的用法:
<p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">属性可选的值有:</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">top、bottom、left、right、center_vertical、fill_vertical、center_horizontal、fill_horizontal、center、fill、clip_vertical。</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">而且这些属性是可以多选的,用“|”分开。</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">默认这个的值是:Gravity.LEFT</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">来自:</p><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">http://blog.youkuaiyun.com/wanderocn/article/details/6424876
</p>
/home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B8.hpp:1:22: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 1 | bool hang_B8_zhi_xing() | ^~ /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B8.hpp:1:22: note: remove parentheses to default-initialize a variable 1 | bool hang_B8_zhi_xing() | ^~ | -- /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B8.hpp:1:22: note: or replace parentheses with braces to value-initialize a variable /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B8.hpp:2:1: error: a function-definition is not allowed here before ‘{’ token 2 | { | ^ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/动作注册.hpp:57, from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:10, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B9.hpp:1:22: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 1 | bool hang_B9_zhi_xing() | ^~ /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B9.hpp:1:22: note: remove parentheses to default-initialize a variable 1 | bool hang_B9_zhi_xing() | ^~ | -- /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B9.hpp:1:22: note: or replace parentheses with braces to value-initialize a variable /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B9.hpp:2:1: error: a function-definition is not allowed here before ‘{’ token 2 | { | ^ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/动作注册.hpp:58, from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:10, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B10.hpp:1:23: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 1 | bool hang_B10_zhi_xing() | ^~ /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B10.hpp:1:23: note: remove parentheses to default-initialize a variable 1 | bool hang_B10_zhi_xing() | ^~ | -- /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B10.hpp:1:23: note: or replace parentheses with braces to value-initialize a variable /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B10.hpp:2:1: error: a function-definition is not allowed here before ‘{’ token 2 | { | ^ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/动作注册.hpp:59, from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:10, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B11.hpp:1:23: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 1 | bool hang_B11_zhi_xing() | ^~ /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B11.hpp:1:23: note: remove parentheses to default-initialize a variable 1 | bool hang_B11_zhi_xing() | ^~ | -- /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B11.hpp:1:23: note: or replace parentheses with braces to value-initialize a variable /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B11.hpp:2:1: error: a function-definition is not allowed here before ‘{’ token 2 | { | ^ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/动作注册.hpp:60, from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:10, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B12.hpp:1:23: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 1 | bool hang_B12_zhi_xing() | ^~ /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B12.hpp:1:23: note: remove parentheses to default-initialize a variable 1 | bool hang_B12_zhi_xing() | ^~ | -- /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B12.hpp:1:23: note: or replace parentheses with braces to value-initialize a variable /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B12.hpp:2:1: error: a function-definition is not allowed here before ‘{’ token 2 | { | ^ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/动作注册.hpp:61, from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:10, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B13.hpp:1:23: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 1 | bool hang_B13_zhi_xing() | ^~ /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B13.hpp:1:23: note: remove parentheses to default-initialize a variable 1 | bool hang_B13_zhi_xing() | ^~ | -- /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B13.hpp:1:23: note: or replace parentheses with braces to value-initialize a variable /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B13.hpp:2:1: error: a function-definition is not allowed here before ‘{’ token 2 | { | ^ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/动作注册.hpp:62, from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:10, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B14.hpp:1:23: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 1 | bool hang_B14_zhi_xing() | ^~ /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B14.hpp:1:23: note: remove parentheses to default-initialize a variable 1 | bool hang_B14_zhi_xing() | ^~ | -- /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B14.hpp:1:23: note: or replace parentheses with braces to value-initialize a variable /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B14.hpp:2:1: error: a function-definition is not allowed here before ‘{’ token 2 | { | ^ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/动作注册.hpp:63, from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:10, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B15.hpp:1:23: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 1 | bool hang_B15_zhi_xing() | ^~ /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B15.hpp:1:23: note: remove parentheses to default-initialize a variable 1 | bool hang_B15_zhi_xing() | ^~ | -- /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B15.hpp:1:23: note: or replace parentheses with braces to value-initialize a variable /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B15.hpp:2:1: error: a function-definition is not allowed here before ‘{’ token 2 | { | ^ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:16, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/黑匣子.hpp: In member function ‘virtual void hang_B7_zhi_xing()::leiHeiXiaZi_2_16::luo_ji(): /home/getcrobot/文件_5_9_16.24现在/include/注册/黑匣子.hpp:75:7: error: use of local variable with automatic storage from containing function 75 | FaBuZhe.luo_ji(); | ^~~~~~~ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:15, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/发布/发布者.hpp:112:17: note: ‘hang_B7_zhi_xing()::LeiFaBuZhe_2_8 FaBuZhe’ declared here 112 | LeiFaBuZhe_2_8 FaBuZhe; | ^~~~~~~ /home/getcrobot/文件_5_9_16.24现在/main/main.cpp: In function ‘bool hang_B7_zhi_xing(): /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:12:1: error: a function-definition is not allowed here before ‘{’ token 12 | { | ^ /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:24:1: error: a function-definition is not allowed here before ‘{’ token 24 | { | ^ /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:33:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 33 | int main() | ^~ /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:33:9: note: remove parentheses to default-initialize a variable 33 | int main() | ^~ | -- /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:33:9: note: or replace parentheses with braces to value-initialize a variable /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:34:1: error: a function-definition is not allowed here before ‘{’ token 34 | { | ^ /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:42:2: error: expected ‘}’ at end of input 42 | } | ^ In file included from /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/动作注册.hpp:55, from /home/getcrobot/文件_5_9_16.24现在/include/注册/功能注册.hpp:10, from /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:7: /home/getcrobot/文件_5_9_16.24现在/include/注册/动作/行B7.hpp:2:1: note: to match this ‘{’ 2 | { | ^ /home/getcrobot/文件_5_9_16.24现在/main/main.cpp:42:2: warning: control reaches end of non-void function [-Wreturn-type] 42 | } | ^ 翻译
最新发布
06-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值