我在滚动布局中添加了一个线性布局,结果线性布局的背景色设置了不起作用了。哪位大侠知道呀,先谢谢了~~
<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>
请给位高手给看看
解决方案 »
- android 使用ListView实现列表,列表中有checkBox,TextView,需实现点击这两个控件能触发不同的动作
- android读取SQLITE数据库问题
- android c
- myeclipse怎么搭建android2.2环境
- 在java main函数中能运行,放在一个activity中就不行了。
- onLongPress手势不能识别
- 请教高手:如何让手机通过蓝牙自动配对一个平板电脑(平板电脑上的蓝牙连接信息通过二维码提供)
- 安卓上利用hook进行透明加解密
- 新手用eclipse建android求助
- idea新建android项目出现的问题
- 咨询手机重启代码含义
- 解释一下这个 送分!
<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 怎么处理 求解 !