2017-09-20 5 views
-2

カスタムダイアログで薄い紫色の線を削除したい...私は、カスタムダイアログの上部を削除したい

カスタムダイアログでは、2つのTextViewと1つのImageViewと1つのボタンがあります。

これはユーザープロフィールに関するもので、[ボタン]をクリックするとプロフィールを編集できます。

私は何が問題なのか分かりません。 purple line

どうすれば問題を解決できますか?

my_profile_dialog.xml

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" android:layout_width="match_parent" 
android:layout_height="@dimen/dialog_height" 
android:background="@color/whiteback"> 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1" 
    android:gravity="center|bottom" 
    android:paddingTop="@dimen/padding_20dp" 
    android:paddingLeft="@dimen/padding_20dp" 
    android:paddingRight="@dimen/padding_20dp"> 
    <ImageView 
     android:id="@+id/dialog_imageIv" 
     android:src="@drawable/logo" 
     android:layout_width="@dimen/logoSize" 
     android:layout_height="@dimen/logoSize" /> 
</LinearLayout> 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1" 
    android:gravity="center" 
    android:padding="@dimen/padding_15dp" 
    android:orientation="vertical"> 
    <TextView 
     android:id="@+id/dialog_nameTv" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="이름" 
     android:textStyle="bold" 
     android:textSize="@dimen/btn_16dp" 
     android:layout_marginBottom="@dimen/padding_5dp"/> 
    <TextView 
     android:id="@+id/dialog_emailTv" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="[email protected]"/> 
</LinearLayout> 
<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="0.5"> 
    <Button 
     android:id="@+id/dialog_editBtn" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@drawable/click_action" 
     android:text="@string/profileEdit" 
     android:textColor="@color/white" 
     android:textStyle="bold"/> 
</LinearLayout> 

MyProfileCustomDialog.java

public class MyProfileCustomDialog extends Dialog { 
public RequestManager mRequestManager; 

private ImageView dialog_myProfileIv; 
private TextView dialog_myProfileNameTv, dialog_myProfileEmailTv; 
private Button dialog_myProfileEditBtn; 
private Context mContext; 

private String userEmail, userName, userImage; 

public MyProfileCustomDialog(@NonNull Context context, String userName, String userEmail, String userImage, RequestManager requestManager) { 
    super(context); 
    this.mContext = context; 
    this.userEmail = userEmail; 
    this.userName = userName; 
    this.userImage = userImage; 
    this.mRequestManager = requestManager; 
} 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 

    WindowManager.LayoutParams lpWindow = new WindowManager.LayoutParams(); 
    lpWindow.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND; 
    lpWindow.dimAmount = 0.8f; 
    getWindow().setAttributes(lpWindow); 

    setContentView(R.layout.my_profile_dialog); 

    dialog_myProfileIv = (ImageView)findViewById(R.id.dialog_imageIv); 
    dialog_myProfileEmailTv = (TextView)findViewById(R.id.dialog_emailTv); 
    dialog_myProfileNameTv = (TextView)findViewById(R.id.dialog_nameTv); 
    dialog_myProfileEditBtn = (Button)findViewById(R.id.dialog_editBtn); 

    dialog_myProfileEmailTv.setText(userEmail); 
    dialog_myProfileNameTv.setText(userName); 

    mRequestManager 
      .load(Uri.parse(userImage)) 
      .centerCrop() 
      .crossFade() 
      .bitmapTransform(new CropCircleTransformation(new CustomBitmapPool())) 
      .signature(new StringSignature(String.valueOf(System.currentTimeMillis()))) 
      .override(200,200) 
      .into(dialog_myProfileIv); 

    dialog_myProfileEditBtn.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View v) { 
      Intent i = new Intent(mContext, EditUserActivity.class); 
      mContext.startActivity(i); 
     } 
    }); 
} 

}

と私はこのような使用..

FragmentSecond.java

MyProfileCustomDialog customDialog = new MyProfileCustomDialog(getContext(), userName, userEmail, userImage, mRequestManager); 
customDialog.show(); 
+0

あなたが提供したスクリーンショットのダイアログでは明るい紫色の線が表示されません – Redman

答えて

0

requestWindowFeature(Window.FEATURE_NO_TITLE)この使用してみてください。あなたが使用してダイアログのタイトルを非表示にすることができ、あなたのダイアログのタイトル

を非表示にするには、

customDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
0

あなたはカスタムダイアログのための新しいスタイルを定義することができ、そのようなテキストの外観、背景色など、すべてのスタイル属性を変更すると、テキストの色。したがって、Style.xmlファイルでは、次のコードのようにアプリケーションのテーマに項目を追加してください:

<style name="AppTheme" parent="AppBaseTheme"> 

    <item name="android:dialogTheme">@style/alertdialog</item> 
</style> 


<style name="alertdialog"> 

    <item name="android:textColor">@android:color/your color</item> 
    <item name="android:fontFamily">your font</item> 
    <item name="android:textStyle">your text style</item> 
</style> 
関連する問題