简体   繁体   English

Android主要XML在2.3和4.0上的工作方式有所不同

[英]android main XML works diffrent on 2.3 and 4.0

this XML works different on 2.3 and 4.0. 此XML在2.3和4.0上的工作方式有所不同。 one of that shows table row elemens left fitted but other centered. 其中之一显示表格行元素保留为左对齐,但其他居中。

thanks for your help 谢谢你的帮助

    <LinearLayout android:id="@+id/Scorelistic"  android:layout_marginLeft="70dp" android:layout_marginTop="30dp" android:layout_gravity="center" android:background="@drawable/bestscore" android:layout_height="267dp" android:layout_width="432dp" android:orientation="vertical" android:weightSum="1">

            <TableLayout android:layout_height="fill_parent" android:weightSum="1" android:layout_marginTop="50dp" android:id="@+id/tableLayout1" android:layout_gravity="center" android:layout_width="fill_parent">
                <TableRow android:layout_height="85dp" android:layout_width="wrap_content" android:id="@+id/tableRow1">
                    <FrameLayout android:layout_width="349dp" android:layout_height="74dp" android:id="@+id/frameLayout5">
                        <ImageView android:layout_height="74dp" android:id="@+id/score1" android:layout_marginLeft="80dp" android:layout_width="349dp" android:background="@drawable/birincibg" android:visibility="visible"></ImageView>
                        <TextView android:id="@+id/birinci" android:textSize="16sp" android:layout_marginLeft="80dp" android:gravity="center" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="#000000"></TextView>
                    </FrameLayout>
                </TableRow>         
              </TableLayout>
        </LinearLayout> 
    </RelativeLayout>
</LinearLayout> 

This can be because you're specifying device points and so the whole layout becomes dependent on your device screen size. 这可能是因为您要指定设备点,因此整个布局取决于您设备的屏幕尺寸。 And so if your two devices have different screen sizes you see the difference. 因此,如果您的两个设备的屏幕尺寸不同,则会看到差异。 It's generally not recommended to use device points in layouts you may want to use gravity, alignments and weights instead. 通常不建议在可能要使用重力,路线和权重的布局中使用设备点。 Especially in TableLayouts you don't really need device points or so it seems 特别是在TableLayouts中,您实际上并不需要设备点,所以似乎

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 android:ContentResolver在4.0上有效,但在2.3上无效 - android: ContentResolver works on 4.0 but not on 2.3 Android代码可在2.3上使用,但不能在4.0上使用 - Android Code Works On 2.3 But Not On 4.0 在Android上捕获媒体按钮> = 4.0(适用于2.3) - Capture media button on Android >=4.0 (works on 2.3) Android 4.0中的类无响应-在2.3及以下版本中有效 - No response from class in Android 4.0 - works in 2.3 and below Android 2.3和4.0之间通过PULL解码XML文件有什么区别吗? - Is there any different between Android 2.3 and 4.0 for decode XML file by PULL? ActionBar - Android平板电脑2.3和4.0 - ActionBar - Android Tablet 2.3 and 4.0 Android应用程序只能在2.3上运行,而不能在4.0上运行 - Android app working on 2.3 but not on 4.0 Phonegap应用程序在运行Android 4.0时引发错误,但在Android 2.3及更低版本上可以正常运行 - Phonegap application throws error running Android 4.0, but works fine on Android 2.3 and below SHOUTCast Streaming Breaks in 4.0+,适用于2.3 - SHOUTCast Streaming Breaks in 4.0+, works in 2.3 Android我的应用程序可以在2.3上运行,但即使在4.0上也无法启动 - Android My application works on 2.3 fine but doesn't start even on 4.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM