English 中文(简体)
Android文载于纽顿——为什么?
原标题:Android Text is wrapped in button - why?

我有以下XML:

<LinearLayout
    android:id="@+id/linearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <T页: 1View
        android:id="@+id/tv1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:t页: 1="@string/verylongt页: 1" android:layout_weight="1000" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:t页: 1="部分案文" android:onClick="onClickButton" android:layout_weight="1" />

</LinearLayout>

虽然我已经设定了排位——体重,但纽伦文中仍然有条不紊之处,但纽伦应当显示。

部分案文

but it shows

缩略语

页: 1

为什么如此,我如何确定?

感谢!

最佳回答

您没有具体说明您的<代码>LinearLayout的取向,因此它偏离了横向。 Text, 载Button。 另外,当你使用<条码>/代谢:中值/代码>时,你往往不想限制相关层面布局中的标本,因此,你可以将“<条码>0px”而不是“<条码>_content 或“match_ng ,让重量决定相应的大小。

问题回答

包括<代码>android:singleLine=“true”至Buttonxml。





相关问题
Very basic WPF layout question

How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...

How to align the text to top of TextView?

How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...

Centring a flow in Shoes

Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...

Overlaying with CSS

I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...

How do you normally make a program look beautiful? [closed]

How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...

热门标签