when the text cell is large尽管有文字包装,但我无法让我的TableLayout适合屏幕内部inside the cell.
这是我的TableLayout.一个简单的两行,两列表.左列细胞是multiline.如果其中一个单元格的文本很大,则需要在两行中断,该列将被拉伸以填满整个屏幕,并且右列被推出屏幕.
为什么?如何强制全桌留在屏幕内?任何提示都受到欢迎.
我的TableLayout如下:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myTableLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<TextView
android:text="Account 4 with a very large name to see if it breaks on two or more lines"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
<TextView
android:text="$400.00"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
</TableRow>
<TableRow>
<TextView
android:text="Account 5"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
<TextView
android:text="$400.00"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
</TableRow>
</TableLayout>
Run Code Online (Sandbox Code Playgroud)
显示布局的代码是基本的:
public class AccountBrowserTest
extends Activity
{
public …Run Code Online (Sandbox Code Playgroud) 我是MVC的新手.我可以将MVC 5.2集成到我现有的Web表单Visual Studio 2012 Update 4项目中.我创建了我的第一个控制器,并且按预期工作.甚至在访问MVC视图时我也能够利用现有项目中的Windows窗体身份验证.但是当创建我的第二个控制器时,它开始变得混乱.
这是我的路线映射:
public static class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.EnableFriendlyUrls();
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
Run Code Online (Sandbox Code Playgroud)
我有两个控制器都位于〜/ Controllers中.我的第一个控制器是:
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
//return View();
return Redirect("~/Default.aspx");
}
public ActionResult CloseSession()
{
return Redirect("http://www.yahoo.com");
}
}
Run Code Online (Sandbox Code Playgroud)
第二个控制器:
public class CajaWebController : Controller
{
//
// GET: …Run Code Online (Sandbox Code Playgroud)