我正在寻找一个Android的UI设计工具.我尝试了很多网站,但找不到任何有用的东西.
一些设计工具仅用于线框,例如http://www.fluidui.com 但它们没有给我一个XML布局源.
我知道:http: //www.droiddraw.org/ 但这个工具很旧,它使用的是AbsoluteLayout,不推荐使用.
在我看来,Eclipse UI设计器工具很难使用.元素的按钮拖放操作无法正常工作.我喜欢Visual Studio的表单设计器,我认为它是C#的最佳设计工具.特别是对于定位 - 拖动任何你想要的东西并放在你想要的地方,它非常容易和有用.
有没有像Visual Studio的Form Designer那样的Android设计工具?
我对如何在固定点环境中处理算术计算感到困惑.考虑以下代码行:
/* unsigned short is 16 bit.*/
unsigned short x = 1000;
unsigned short res;
/* Case1: The following yields correct result in res */
res = (x*544/100);
/* Case2: The following yields wrong result in res*/
res = (x*544); /* expected overflow here */
res = res/100;
Run Code Online (Sandbox Code Playgroud)
所以,我的问题是:我可以看出为什么案例2会产生错误的结果.但是 - 编译器在情况1中产生正确结果的是什么? - 在案例1中,算术运算不是基本相同吗?除此之外,它分为两个陈述? - 我可以期待来自不同编译器的不同行为吗?
我是CMake和DBus的新手.我按照这里的指南进行操作,并编写和执行基本程序.
我遇到的第一个问题是我的程序找不到
<dbus/dbus.h>
Run Code Online (Sandbox Code Playgroud)
我通过在我的CMakeList.txt中添加一些include目录解决了这个问题.目前,我的CMakeLists.txt看起来像这样:
...
include_directories(/usr/lib/)
include_directories(/usr/include/dbus-1.0/)
include_directories(/usr/lib/x86_64-linux-gnu/dbus-1.0/include)
include_directories(/usr/include/glib-2.0)
include_directories(/usr/lib/x86_64-linux-gnu/glib-2.0/include/)
set (LIBS
dbus-1
dbus-glib-1
)
add_executable(mydbus mydbus.cpp)
target_link_libraries(mydbus ${LIBS} )
Run Code Online (Sandbox Code Playgroud)
现在,我的程序抱怨无法找到dbus-arch-deps.h
/usr/include/dbus-1.0/dbus/dbus.h:29:33: fatal error: dbus/dbus-arch-deps.h: No such file or directory
#include <dbus/dbus-arch-deps.h>
Run Code Online (Sandbox Code Playgroud)
我知道解决方法是使用正确的命令行标志或pkg-config.正如这里讨论的和许多其他帖子.
但是,我不知道如何配置CMakeLists.txt以产生类似的效果.
我的猜测是将类似find_package(dbus-1)的内容添加到CMakeLists.txt中.如果这是正确的,我将不得不写自己的Finddbus-1.cmake.这听起来不错吗?或者有更简单的方法吗?
我会感激任何指针.