我在滚动布局中添加了一个线性布局,结果线性布局的背景色设置了不起作用了。哪位大侠知道呀,先谢谢了~~
<ScrollView android:id="@+id/ScrollView01"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</LinearLayout>
</ScrollView>
请给位高手给看看
<ScrollView android:id="@+id/ScrollView01"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</LinearLayout>
</ScrollView>
请给位高手给看看
<ScrollView android:id="@+id/ScrollView01"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:background="@drawable/green">
</LinearLayout>
</ScrollView>
<drawable name=green>0xff00ff00</color>
单一的线性布局怎么弄都可以,把它放在滚动布局中就不行了。
Drawable d = res.getDrawable(R.drawable.other<color.xml文件中的名称>);
http://androidforums.com/application-development/50090-custom-view-inside-scrollview.html
可以把ScrollView的宽高设置为固定值试试。
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout
android:id="@+id/LinearLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:background="@drawable/lbl">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
</ScrollView>
如5楼 说的 ,你必须在里面加了组件阿 才能看出背景颜色啊 你什么都没有 怎么能看到呢我试过了 可以看到的
我也试了,可以看到的,你不妨在linearLayout里面放一个 Button,试试
你高错了!
需要特殊处理。
继续关注
我就是加了一个ListView 怎么处理 求解 !