Skip to content

Commit 537f065

Browse files
author
hongyangAndroid
committed
add FAQ
1 parent eb08b57 commit 537f065

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,25 @@ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
283283

284284
### TextView的高度问题
285285

286-
设计稿一般只会标识一个字体的大小,比如你设置textSize="20px",实际上TextView所占据的高度肯定大于20px,字的上下都会有一定的建议,所以一定要灵活去写字体的高度,比如对于text上下的margin可以选择尽可能小一点。或者选择别的约束条件去定位(比如上例,选择了marginBottom)
286+
设计稿一般只会标识一个字体的大小,比如你设置textSize="20px",实际上TextView所占据的高度肯定大于20px,字的上下都会有一定的间隙,所以一定要灵活去写字体的高度,比如对于text上下的margin可以选择尽可能小一点。或者选择别的约束条件去定位(比如上例,选择了marginBottom)
287+
288+
289+
## 常见问题
290+
291+
###(1)导入后出现`org/gradle/api/publication/maven/internal/DefaultMavenFactory`
292+
293+
最简单的方式,通过`compile 'com.zhy:autolayout:x.x.x'`进行依赖使用,如果一定要以module引用,参考该issue[#74](https://github.com/hongyangAndroid/AndroidAutoLayout/issues/74)
294+
295+
###(2)RadioGroup,Toolbar等控件中的子View无法完成适配
296+
297+
这个其实上文已经提到过了,需要自己扩展。不过这个很多使用者贡献了他们的扩展类可以直接使用,
298+
参考[autolayout-widget](https://github.com/hongyangAndroid/AndroidAutoLayout/tree/master/widgetsample),
299+
如果没有发现你需要的容器类,那么你就真的需要自行扩展了,当然如果你完成了扩展,可以给我发个PR,或者让我知道,我可以加入到
300+
`autolayout-widget`中方便他人,ps:需要用到哪个copy就好了,不要直接引用`autolayout-widget`,因为其引用了大量的库,可能很多
301+
库你是用不到的。
302+
287303

288-
##TODO
289304

290-
* 增加单个Activity横屏布局的支持(设计图必须是横屏的)
291-
* 完善demo(复杂的,简单的,ListView的各种)
292305

293306
## 其他信息
294307

autolayout/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'com.github.dcendents.android-maven'
33
apply plugin: 'com.jfrog.bintray'
44

5-
version = "1.4.3"
5+
version = "1.4.4"
66

77
android {
88
compileSdkVersion 23
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.zhy.autolayout">
1+
<manifest package="com.zhy.autolayout">
32

4-
<application android:allowBackup="true"
5-
android:label="@string/app_name"
6-
>
7-
8-
</application>
93

104
</manifest>

autolayout/src/main/java/AutoContentFrameLayout.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public AutoContentFrameLayout(Context context, AttributeSet attrs)
2626
public AutoContentFrameLayout(Context context, AttributeSet attrs, int defStyleAttr)
2727
{
2828
super(context, attrs, defStyleAttr);
29+
2930
}
3031

3132
@Override

sample/src/main/java/com/zhy/sample/CategoryActivity.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.zhy.sample;
22

3+
import android.content.Context;
34
import android.os.Bundle;
45
import android.support.design.widget.TabLayout;
56
import android.support.v4.app.Fragment;
@@ -19,6 +20,12 @@ public class CategoryActivity extends AutoLayoutActivity
1920
{"单个UI", "正方形"};
2021

2122

23+
@Override
24+
public Context getBaseContext()
25+
{
26+
return super.getBaseContext();
27+
}
28+
2229
@Override
2330
protected void onCreate(Bundle savedInstanceState)
2431
{

0 commit comments

Comments
 (0)