我使用的视图只有10dp高度,因此它看起来像一条线。“线条”视图的最大宽度
如果我的layout_width大于某个数字(例如,如果我设置了layout_width = 900dp),那么该视图不会占用宽度......看起来视图的宽度最大。 有谁知道?
谢谢。闫。
编辑:对不起,这是我的XML布局。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.test.MainActivity" >
<View
android:background="@color/black"
android:layout_width="900dp"
android:layout_height="10dp"
android:transformPivotX="5dp"
android:rotation="45"/>
</RelativeLayout>
编辑2:结果如下。为什么观点不能进一步? http://image.noelshack.com/fichiers/2014/40/1411963572-screenshot-2014-09-28-22-36-32.png
父视图宽度限制? – skywall 2014-09-28 20:22:23
将您的XML添加到问题 – 2014-09-28 20:27:14
也将视图的宽度设置为match_parent。 – CENT1PEDE 2014-09-28 21:16:46