我正在为Activity我的Android应用程序中的登录工作.下面的图片是我希望它看起来像:

我能够使用以下XML实现此布局.问题是,它有点hackish.我不得不为主机EditText硬编码宽度.具体来说,我必须指定:
android:layout_width="172dp"
Run Code Online (Sandbox Code Playgroud)
我真的想给主机和端口EditText提供一个百分比宽度.(主机为80%,端口为20%.)这可能吗?以下XML适用于我的Droid,但似乎并不适用于所有屏幕.我真的想要一个更强大的解决方案.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/host_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/home"
android:paddingLeft="15dp"
android:paddingTop="0dp"
android:text="host"
android:textColor="#a5d4e2"
android:textSize="25sp"
android:textStyle="normal" />
<TextView
android:id="@+id/port_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/home"
android:layout_toRightOf="@+id/host_input"
android:paddingTop="0dp"
android:text="port"
android:textColor="#a5d4e2"
android:textSize="25sp"
android:textStyle="normal" />
<EditText
android:id="@+id/host_input"
android:layout_width="172dp"
android:layout_height="wrap_content"
android:layout_below="@id/host_label"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="4dp"
android:background="@android:drawable/editbox_background"
android:inputType="textEmailAddress" />
<EditText
android:id="@+id/port_input"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_below="@id/host_label"
android:layout_marginTop="4dp"
android:layout_toRightOf="@id/host_input"
android:background="@android:drawable/editbox_background"
android:inputType="number" />
<TextView
android:id="@+id/username_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/host_input"
android:paddingLeft="15dp"
android:paddingTop="15dp"
android:text="username"
android:textColor="#a5d4e2"
android:textSize="25sp"
android:textStyle="normal" />
<EditText
android:id="@+id/username_input"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/username_label"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="4dp"
android:background="@android:drawable/editbox_background" …Run Code Online (Sandbox Code Playgroud) 虽然大多数苹果文档编写得很好,但我认为" iOS事件处理指南 "是一个例外.我很难清楚地了解那里描述的内容.
该文件说,
在命中测试中,窗口调用
hitTest:withEvent:视图层次结构的最顶层视图; 此方法通过递归调用pointInside:withEvent:视图层次结构中返回YES的每个视图继续进行,继续向下移动层次结构,直到找到触摸发生在其边界内的子视图.该视图成为热门测试视图.
那么只有hitTest:withEvent:系统调用最顶层的视图,调用pointInside:withEvent:所有子视图,如果从特定子视图返回是YES,那么调用pointInside:withEvent:该子视图的子类?
如果我是正确的,我在使用 Stopwatch.GetTimeStamp 时绝对不会出现 stackoverflow 错误,尤其是在启动程序后。
这是我的代码:
if (currentTicks >= lastTicks + interval)
{
lastTicks = currentTicks;
return true;
}
Run Code Online (Sandbox Code Playgroud)
currentTicks 由 Stopwatch.GetTimeStamp() 放置。这段代码位于一个名为“infinitely”的方法中(我用它来控制 FPS)。有人有什么想法吗?
编辑:主表单代码:
Game game;
public Form1()
{
InitializeComponent();
game = new Game(Stopwatch.Frequency / 45);
MainLoop();
}
public void MainLoop()
{
if (game.DrawStuff(Stopwatch.GetTimestamp()))
{
Invalidate();
}
MainLoop();
}`
Run Code Online (Sandbox Code Playgroud)
然后,游戏类:
public long lastTicks { get; set; }
public double interval { get; set; }
public Game(double Interval)
{
interval = Interval;
}
public bool DrawStuff(long currentTicks)
{ …Run Code Online (Sandbox Code Playgroud) 我正在寻找一些帮助C++的工具,就像checkstyleJAVA一样.它应该可用于LINUX.
你们都知道吗?
我正在运行一个jnlp文件中的应用程序,该文件包含有用的信息,例如供应商,描述和其他字段.
在运行时获取此数据以构建"关于"对话框的最合理方法是什么?
有没有办法检测应用程序是否在没有Java Web Start的情况下启动?
谢谢你的帮助.
皮埃尔
我试过在一行上单词"quit",但这似乎只是将命令行指针从">"更改为">>".在交互式Lua中结束会话的最佳方法是什么?
我们正在开发一个开源和免费的大型数据库驱动的Web应用程序.对于这个项目,我们已经选择PostgreSQL作为数据库平台并启动了数据库工作.
我们已经使用了一段时间的微软技术,并且在一个盒子里集成了很多东西.使用Visual Studio,它很容易让它工作.
对于我们的新项目,我们不希望我们的客户被迫支付Windows Server许可证,因此正在寻找一种新的技术,类似的ASP.NET(可能更好或更差),可以在客户端站点上实现免许可证部署.
除了Web技术要求之外,我们理想地喜欢具有Web技术的IDE,它提供IDE与OS和服务器(Web服务器,调试器等等)之间的集成,就像Visual Studio一样.IDE可以是商业的或免费的.
理想情况下,我们希望保持ASP.NET并同时"免费".
由于Oracle威胁,我们没有考虑项目的"Java".我们也考虑过Mono,但害怕在生产环境中使用它.
所以我按照指示行事,并且做了:
./configure --prefix=/fmac/users/f****/apacheServer \
--exec-prefix=/fmac/users/f*****/apaacheServer
Run Code Online (Sandbox Code Playgroud)
它似乎没有任何错误或任何工作.
然后我做:
make
make install
Run Code Online (Sandbox Code Playgroud)
我在安装时收到以下错误:
libtool: install: error: cannot install `libaprutil-1.la' to a directory not
ending in /usr/local/apache2/lib
Run Code Online (Sandbox Code Playgroud)
任何想法为什么还有一些其他配置var我需要设置?
我正在尝试更多地了解NoSQL,因为我正在Linux/PHP架构中构建基于密钥的归档应用程序.任何人都可以解释主要解决方案(CouchDB/MongoDB /等)之间的差异,以及每个解决方案的优缺点吗?链接会很棒,但我很难单独使用谷歌进行研究.
我需要从mysql表中检索具有唯一值的最新行.简单的表格布局是时间戳(now())和用户名列.该表每秒获取几次新数据,我需要用户名唯一的最新行.
SELECT MAX(timestamp) as timestamp, username
FROM bla
WHERE timestamp < (now() - interval 30 minute)
GROUP BY username
ORDER BY timestamp DESC
Run Code Online (Sandbox Code Playgroud)
看来这个查询没有返回最新值,可能是因为该组正在做一些我不想要的事情......