Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

适配的小问题?? #6

Closed
liguangze opened this issue Aug 9, 2018 · 3 comments
Closed

适配的小问题?? #6

liguangze opened this issue Aug 9, 2018 · 3 comments

Comments

@liguangze
Copy link

UI在720x1280上做的图,其中一个按钮的宽高分辨为:宽720px,高为100px,字体大小为30px,
因为基准是在480*320
手机不论是720x1280还是1080x1920的上面

假如要是在UI在1080x1920上做的图 宽720px,高为100px,字体大小为30px
手机不论是720x1280还是1080x1920的上面

跟手机的分辨率没有关系,手机会去不同的文件夹去寻找吗,是这个意思吗

@wildma
Copy link
Owner

wildma commented Aug 10, 2018

@liguangze 也不是没关系,应该说不是由分辨率决定的。而是由设备最小宽度决定,而设备最小宽度是由分辨率和密度决定的。设备是根据最小宽度寻找不同的文件。

@liguangze
Copy link
Author

@wildma 感谢,现在已经明白了,感谢开源

@wildma wildma closed this as completed Sep 8, 2018
@liguangze
Copy link
Author

_20180910103811
_20180910103826

现在我是按着教程走的,生成了N多的values,,但是在480*800上还是没有适配好呢
这是啥原因的

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="国五92#汽油"
                    android:textColor="@color/home_text_33"
                    android:textSize="@dimen/sp_14"/>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/dp_28"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="5402吨"
                        android:textColor="@color/main_red"
                        android:textSize="@dimen/sp_21"
                        />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="元/吨"
                        android:textColor="@color/home_text_99"
                        android:textSize="@dimen/sp_12"
                        />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/dp_25"
                        android:text="已售2563吨"
                        android:textColor="@color/home_text_99"
                        android:textSize="@dimen/sp_12"
                        />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"

                    android:layout_marginTop="@dimen/dp_10"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">


                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:orientation="horizontal">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="北京一石科技"
                            android:textColor="@color/home_text_99"
                            android:textSize="@dimen/sp_12"/>

                        <TextView
                            android:id="@+id/tv_memeber"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="@dimen/dp_10"
                            android:background="@drawable/bg_red_line_corner"
                            android:text="会员价"
                            android:textColor="@color/main_red"
                            android:textSize="@dimen/sp_12"
                            android:visibility="gone"/>

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="@drawable/bg_red">

                        <TextView
                            android:id="@+id/tv_now_price"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="@dimen/dp_3"
                            android:layout_marginLeft="@dimen/dp_10"
                            android:layout_marginRight="@dimen/dp_10"
                            android:layout_marginTop="3dp"

                            android:text="立即报价"
                            android:textColor="@color/white"/>
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>

这是部分代码,求大神指教下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants