时间紧张,先记一笔,后续优化与完善。

直接上代码和图片。

情况一:

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="horizontal" >    <fragment        android:id="@+id/titles"        android:layout_width="0dip"        android:layout_height="match_parent"        android:layout_weight="1"        class="com.a2bgeek.fragmentdemo.TitlesFragment" />    <FrameLayout        android:id="@+id/details"        android:layout_width="0dip"        android:layout_height="match_parent"        android:layout_weight="2" >    </FrameLayout></LinearLayout>

情况控件Android layout_weight用法图解_第1张图片

情况2:

每日一道理
爱心是一片照射在冬日的阳光,使贫病交迫的人感到人间的温暖;爱心是一泓出现在沙漠里的泉水,使濒临绝境的人重新看到生活的希望;爱心是一首飘荡在夜空的歌谣,使孤苦无依的人获得心灵的慰藉。
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="horizontal" >    <fragment        android:id="@+id/titles"        android:layout_width="match_parent"        android:layout_height="match_parent"        android:layout_weight="1"        class="com.a2bgeek.fragmentdemo.TitlesFragment" />    <FrameLayout        android:id="@+id/details"        android:layout_width="match_parent"        android:layout_height="match_parent"        android:layout_weight="2" >    </FrameLayout></LinearLayout>

情况控件Android layout_weight用法图解_第2张图片

情况三:

Fragment这个货色在wrap_content的情况下会占领全部,和控件不太一样。

对于一般的控件来讲,可以参考http://blog.csdn.net/jincf2011/article/details/6598256

文章结束给大家分享下程序员的一些笑话语录: 一位程序员去海边游泳,由于水性不佳,游不回岸了,于是他挥着手臂,大声求.救:“F1,F1!”

更多相关文章

  1. Android 自定义日期控件,包含月控件
  2. Android Spinner控件之键值对用法
  3. 【Android】抽屉控件 SlidingDrawer 的简单示例
  4. Android 自定义日历控件
  5. Android TextView控件文字添加下划线
  6. Android 三角标签(自定义Textview控件)
  7. Android ToggleButton控件的用法
  8. 两种方式使用android时间和日期控件
  9. android 下动态获取控件的id

随机推荐

  1. 关于 Android(安卓)4.4 系统屏幕旋转调研
  2. Android中使用高德地图inflating class c
  3. Android第九课 Toast 用法注意事项
  4. Android移动终端数据同步技术收集贴
  5. 【Android(安卓)View】Android中View对触
  6. android 修改actionbar title文字颜色等
  7. 短视频app开源源码android 给图片加文字
  8. Android下的应用编程——用HTTP协议实现
  9. Android(安卓)代码实现logcat输出到文件
  10. linux下配置android sdk